Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Alpha549
Creator II
Creator II

ESB : works well running from Studio but not from the runtime

Hello everyone,

I'm playing with ESB, and I created a simple job using a tRestRequest and tRestResponse. It works perfectly executing from the Studio, and Postman (or directly in the browser). However, when I use trun locally (after stopping the job in the Studio), it doesn't work, I have no response. My bundle is Active (bundle:status id)...

In the browser I get the message :

localhost doesn't authorize connection

ERR_CONNECTION_REFUSED

I might not have done something which is necessary

Thank you for your light 🙂

Labels (2)
16 Replies
Alpha549
Creator II
Creator II
Author

I've renamed the job, and here it is :

 

0695b00000PK0XFAA1.png 

 

0695b00000PK0XZAA1.png 

Here is the tesb.log : https://pastecode.io/s/m08df6tu

 

This should be correct now, sorry

Anonymous
Not applicable

OK, I believe I know what is going wrong for you here. This is down to a configuration of the TOS ESB settings. Open Preferences and go to the Maven branch. You should see this....

 

0695b00000PK27EAAT.pngThe 2 tick boxes that I have circle, need to be unticked. Then click "Apply and Close".

 

After that, recompile your service, remove the old one from your deploy folder and add the new one. You should then see it appear on the http://localhost:8040/services screen.

 

EDIT: On second thoughts, only untick the "Offline" tick box. That should solve this for you. Leave the other one ticked. Try with that first. If it doesn't work, then untick the other option.

Alpha549
Creator II
Creator II
Author

IT WORKS ! Thanks you @Richard Hall​ 

 

Ok Maven was configured on Offline. Indeed, the generated jar was very small, about 2ko. Now it's online, the generated jar is about 4MO ! 🙂

 

0695b00000PK3aWAAT.png 

🙂

 

I have another question @Richard Hall​ 

I want to have very simple jobs. It's also to be able to update api methods.

 

I have one job which return hello :

 

0695b00000PK3n1AAD.png 

0695b00000PK3nQAAT.png 

And another one to say bye :

 

0695b00000PK3jUAAT.png 

0695b00000PK3nkAAD.png 

As I don't specify any port in REST Endpoint, I saw that my bye bundle status is Failure

 

0695b00000PK3pHAAT.png 

As they are different jobs, the port should be different isn't ? So should I specify the port manually in REST Endpoint ?

Anonymous
Not applicable

I suspect that this is because they both share the same REST Endpoint. If you stop the "api_hello" service and restart the "api_bye" service, you will see that it will work.

 

To get around this all you need to do is either give them different endpoints OR (a better solution in this case), have an output for "hello" and an output from "bye" in the same tRESTRequest component in the same job. You then have 2 paths coming from the tRESTRequest and you can just link the paths you are showing in your 2 jobs into the 1 job.

Alpha549
Creator II
Creator II
Author

"I suspect that this is because they both share the same REST Endpoint. If you stop the "api_hello" service and restart the "api_bye" service, you will see that it will work."

 

Yes it's what I think. There is the same port 8040 and the same endpoint /api/ in the beginning.

So I did like this :

 

0695b00000PKC9PAAX.png 

And

 

0695b00000PKC9jAAH.png 

The services page I get :

 

0695b00000PKC9yAAH.png 

It's perfectly what I want.

Now the two job are not interdependent. Somebody can work on a job, so an endpoint, and another one can work on another endpoint. The two endpoints can be updated without having any effect or another one.

 

I could put the two flows in the same job, but the job would become gigantic with more endpoints, so here it's simple, what I want 🙂

 

I have another question haha :

On the deployment server (Linux), there is no visual interface. The connection is via SSH. So I can't open any browser on localhost:8040/services

I had the idea of using curl "localhost:8040/services"

This works and I have a return like this :

 

0695b00000PKCHdAAP.png 

Do you know if there is a prettier solution to get services URL or if I can use this one ?

Anonymous
Not applicable

I'm assuming your Linux server is on a network that you are on or have access to? If so, all you need to do is replace "localhost" with the server's IP address. You can look at it from any device with a visual interface.

Alpha549
Creator II
Creator II
Author

Ok, yeah, simply like that, as the <IP address>:8040/services/endpoint doesn't change.

 

All my questions are answered now @Richard Hall​ 

Thank you very much for your help and patience ! 🙂