Apigee Edge + Node.js + Java Spring Boot + Azure Cloud

I am working on a project where I have to use Apigee Edge as a data service layer. where we will expose our APIs using Node.js. Here I am facing below issues:

1. How to connect Multiple ERPs (SAP, Oracle,Symix..etc..) and fetch data in node.js using Apigee edge?

2. How to combine data from different ERPs and expose using GET call. We will call this GET method from Azure cloud and stored in Azure Database.

Details:

1. Multiple ERPs (SAP, Oracle,Symix..etc..) as a database.

2. Apigee as a dataservice API.

3. Azure will call Apigee's API and store data in DB.

Please suggest me how to proceed with this.

Solved Solved
1 3 1,577
1 ACCEPTED SOLUTION

ok, let's break it down.

> How to connect Multiple ERPs (SAP, Oracle,Symix..etc..) and fetch data in node.js

This is a simple matter of using the appropriate nodejs modules for those resources, and a layer like async to parallelize the calls out to the various systems . This is a well understood pattern in nodejs, independent of Apigee Edge.

For example, using the async module,

async.parallel([
        function(callback){
             callback(null,1)
        },
        function(callback){
             callback(null,2)
        },      
    ],
    function(error, results){
       console.log(results); //Output [1,2]
    });

Of course, the array of functions that you call there, can be anonymous or not. It's up to you. So it could look more like this:

function callOracle(cb) { 
  // do work here
  cb(null, resultFromOracle); 
}
...
async.parallel([ callOracle, callSAP, callSymix ],
    function(error, results){
       console.log(results); //Output [fromOracle, fromSAP, fromSymix ]
    });

ok, that's the pattern in nodejs. As to the details of what needs to happen in the callOracle function (and so on), well that depends on which nodejs module you use to connect to Oracle and what you want to do. So I'll leave that to you.

Now, the next part of the question is, how do you do that within Apigee Edge?

And the answer to that part is easy - you host that nodejs code just as you would host any nodejs code in Apigee Edge. It's not different. If you use Express, then I suppose the call to async.parallel() will be dropped into an app.get() call, or something like that.

app.get('/mashup', function(request, response) {
  response.header('Content-Type', 'application/json');
  async.parallel([ callOracle, callSAP, callSymix ],
    function(error, results){
       // maybe do some post-processing here.
       if (error) {
          return response.status(500).send(error);
       }
       // console.log(results); // Output [fromOracle, fromSAP, fromSymix ]
       response.status(200).send(results);
    });
});

I think Spring Boot and Azure... which you mentioned in the question title... I think those details are irrelevant, if I have understood your question correctly. Those are simply implementation details of the caller , as I understand it. And you don't care about that. It's just a REST client, as far as you're concerned, if I have it right.

Finally, there have been some updates to the nodejs support in Apigee Edge since 4.15.04. You may want or need them, depending on the nodejs modules you use. I believe there is a way to update trireme for Apigee Edge - check the archives on community (and specifically this post), or inquire with your support person at Apigee.

View solution in original post

3 REPLIES 3

I am using Apigee Edge on premises Version 4.15.04.00.

ok, let's break it down.

> How to connect Multiple ERPs (SAP, Oracle,Symix..etc..) and fetch data in node.js

This is a simple matter of using the appropriate nodejs modules for those resources, and a layer like async to parallelize the calls out to the various systems . This is a well understood pattern in nodejs, independent of Apigee Edge.

For example, using the async module,

async.parallel([
        function(callback){
             callback(null,1)
        },
        function(callback){
             callback(null,2)
        },      
    ],
    function(error, results){
       console.log(results); //Output [1,2]
    });

Of course, the array of functions that you call there, can be anonymous or not. It's up to you. So it could look more like this:

function callOracle(cb) { 
  // do work here
  cb(null, resultFromOracle); 
}
...
async.parallel([ callOracle, callSAP, callSymix ],
    function(error, results){
       console.log(results); //Output [fromOracle, fromSAP, fromSymix ]
    });

ok, that's the pattern in nodejs. As to the details of what needs to happen in the callOracle function (and so on), well that depends on which nodejs module you use to connect to Oracle and what you want to do. So I'll leave that to you.

Now, the next part of the question is, how do you do that within Apigee Edge?

And the answer to that part is easy - you host that nodejs code just as you would host any nodejs code in Apigee Edge. It's not different. If you use Express, then I suppose the call to async.parallel() will be dropped into an app.get() call, or something like that.

app.get('/mashup', function(request, response) {
  response.header('Content-Type', 'application/json');
  async.parallel([ callOracle, callSAP, callSymix ],
    function(error, results){
       // maybe do some post-processing here.
       if (error) {
          return response.status(500).send(error);
       }
       // console.log(results); // Output [fromOracle, fromSAP, fromSymix ]
       response.status(200).send(results);
    });
});

I think Spring Boot and Azure... which you mentioned in the question title... I think those details are irrelevant, if I have understood your question correctly. Those are simply implementation details of the caller , as I understand it. And you don't care about that. It's just a REST client, as far as you're concerned, if I have it right.

Finally, there have been some updates to the nodejs support in Apigee Edge since 4.15.04. You may want or need them, depending on the nodejs modules you use. I believe there is a way to update trireme for Apigee Edge - check the archives on community (and specifically this post), or inquire with your support person at Apigee.

Do I need Node.js? Can I use only Spring Boot with Apigee?