How to consume a vConnect Service or API in custom java code?

I want to consume an already configured vConnect API in my custom java code.

Is there any library available to access my VRT?

@Mayank @naveen.gupta @Vikas_Dhillon

Yes, we can use below boilerplate dependency in our spring boot java code:

        <dependency>
            <groupId>com.decimaltech.boot</groupId>
            <artifactId>decimal-spring-boot-starter</artifactId>
            <version>0.0.7</version>
        </dependency>
@Autowired
 VahanaFactory vahanaFactory;
// Call Vahana Component (DBES,VAHANAHUB,DBES,IGW,SERVICE)
VahanaConnector connector = vahanaFactory.getConnector(Api.IGW); // DBES/VAHANAHUB,SERVICE
 Object o = connector.performVahanaIntegration(identifier, "<API_NAME/SERVICE_NAME>", headers, request);

Thanks for this.
Can you elaborate this?

For e.g. what do we need in case of

  1. Service
  2. API
    2.a Thrid Party
    2.b Database

Also what if we want the same functionality in other languages like python and nodejs?

We have different types of Vahana Connectors.
For Service:

VahanaConnector connector = vahanaFactory.getConnector(Api.SERVICE);
 Object o = connector.performVahanaIntegration(identifier, "<SERVICE_NAME>", headers, request);

For DBES API:

VahanaConnector connector = vahanaFactory.getConnector(Api.DBES);
 Object o = connector.performVahanaIntegration(identifier, "<API_NAME>", headers, request);

For IGW API:

VahanaConnector connector = vahanaFactory.getConnector(Api.IGW);
 Object o = connector.performVahanaIntegration(identifier, "<API_NAME>", headers, request);

For VahanaHub:

VahanaConnector connector = vahanaFactory.getConnector(Api.VAHANAHUB);
 Object o = connector.performVahanaIntegration(identifier, "<API_NAME>", headers, request);

For Other Rest API:

VahanaConnector simpleRestConnector = vahanaFactory.getConnector(Api.SIMPLE_REST);
String o = simpleRestConnector.performRestIntegration(identifier, new HttpHeaders(), HttpMethod.GET, "url", "",String.class);
 
2 Likes

This library is currently available in Java Only.

Great! thanks a ton.