3 Replies Latest reply on Aug 14, 2019 5:55 PM by Ramesh Reddy

    Teiid Spring Boot - JDBC connection?

    Mathieu Rampant Newbie

      Hi Guys,

      After implementing a solution that has worked for us for a bit more than a year using Teiid Designer & Teiid on wildfly, I am thinking about updating said application.

      I am inclined to go with the Teiid with Spring Boot approach, which will require redefining sources and views again in Java (probably Kotlin)

      I know I probably could just redeploy using my vdb, but since Teiid Designer is obsolete I don't really know how I would go about maintaining/updating that vdb in the future.

      I wanted to try out the Syndesis/Openshift approach, but since it requires a subscription I am not inclined to do that (also seems a bit overkill for my use case)

       

      Now, my biggest concern is on exposing the data. Is there another approach, other than ODATA v4?

      Is it possible (without too much hassle) to expose the data using JDBC with Teiid with Spring Boot?

       

      Thanks!

      Mathieu

        • 1. Re: Teiid Spring Boot - JDBC connection?
          Ramesh Reddy Master

          >I am inclined to go with the Teiid with Spring Boot approach, which will require redefining sources and views again in Java (probably Kotlin)

          You do not need to redesign the views in JAVA but you can use your previous VDB. What you need to do run the migration utility in the Designer to generate XML based VDB, then convert from XML VDB to DDL based VDB

          using https://github.com/teiid/teiid-openshift-examples#vdb-migration-utility

           

          > I don't really know how I would go about maintaining/updating that vdb in the future.

          Once you have the VDB in DDL, the idea is to directly manipulate the DDL to do any edits. This way you can even check in the VDB's DDL into source control systems like Git.

           

          > I wanted to try out the Syndesis/Openshift approach, but since it requires a subscription I am not inclined to do that (also seems a bit overkill for my use case)

          It is not a subscription, you can tryout on Minishift, but if your architecture is not towards cloud then yes you may be correct. But SpringBoot version is just a Java application works more or less like the WidlFly based VDB.

           

          Once you have the VDB follow the example here teiid-spring-boot/samples/vdb at master · teiid/teiid-spring-boot · GitHub to take the VDB and create a Spring Boot based application. As part of this you need to create a data source for each of the sources you are using. This example shows a relational database, but there are examples for other types of data sources,

           

          >Now, my biggest concern is on exposing the data. Is there another approach, other than ODATA v4?

          No, all the previous methods of access from before are still preserved in Spring Boot port.

           

          >Is it possible (without too much hassle) to expose the data using JDBC with Teiid with Spring Boot?

          Yes, it is as simple as adding a property "teiid.jdbc-enable=true" in the application.properties file. However, by default, there is no security, if security is needed you need to plug in your own modules there. So, far we only added OAuth based security for OData V4 using Keycloak, we want to add Kerberos using the Keycloak too in coming versions.

           

          Any issues let us know.

          • 2. Re: Teiid Spring Boot - JDBC connection?
            Mathieu Rampant Newbie

            I am going to go with Teiid Spring Boot then, and see how cumbersome it is to maintain the VDB in DDL.

            In terms of security, I'll either add a spring-security module or just have it handled by our reverse proxy.

             

            Thank you for all the information, that is most helpful

            • 3. Re: Teiid Spring Boot - JDBC connection?
              Ramesh Reddy Master

              I suspect the initial move is going to be little cumbersome, but once you have the DDL (DDL VDB · GitBook) and working IMO it will be a lot more straight forward and easier development model than what we had with Designer/Wildfly based model. Note we follow a lot of SQL/MED semantics which is standard here. Another good thing is if your client is also written in Java, you embed this into the application in the single VM.

               

              Yes, you can add spring security module, we just did not have an example for JDBC. The same is done for OData with keycloak. If you work out an example please consider contributing back.