1

I send Callout request to ActiveMq messages queue service to get messages form there and handle it in Salesforce. In the Queue there are 3000 messages. When I send the request from salesforce sometime I get message with status code 200 and sometime I get a blank body with status code 204. This is very weird.

When I use Rest client like postman to send the Get Request I get always a message.

The Code For make a Request From Salesforce is:

        HTTPRequest jmsRequest = new HTTPRequest();
        jmsRequest.setMethod('GET');
        jmsRequest.setEndpoint('callout:ActiveMqJms');  
        jmsRequest.setTimeout(120000); 
        jmsRequest.setHeader('Accept', 'application/xml');

        Http http            = new Http();
        HttpResponse response = http.send(jmsRequest);

Is there someonr here can help me. I will appreciate that

closed as off-topic by Jayant Das, Vigneshwaran G, battery.cord, glls, Pranay Jaiswal Apr 15 at 10:14

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Programming questions not specific to Salesforce are off-topic here, but can be asked on Stack Overflow." – Jayant Das, Vigneshwaran G, battery.cord, glls, Pranay Jaiswal
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    You will need to verify this with your Azure Team for this behavior. You can only construct and send the request to the endpoint, how the endpoint returns the results is up to it. – Jayant Das Apr 12 at 14:04
  • @Jayant Das Why Azure Team? this is not relevant to Azure team. The end point return always messages to post man but to salesforce not. this is strange – AZIZ Apr 12 at 18:16
  • That was a typo, I read ActiveMQ as Azure somehow while responding. What I had meant was your Middleware Team whoever manages the queue. If you are getting 204, that signifies that there's no content in the Queue and that if you already had hit the endpoint, the Queue may have got cleared. You will need to verify with your MW Team as how GET works in this case. – Jayant Das Apr 12 at 18:22
  • I started taking a look around on this topic and could see some behavior with REST calls as mentioned in this link. Most likely you are having an issue with the session here as mentioned in the link. You will get more response either on stackoverflow or where ActiveMQ is being discussed. – Jayant Das Apr 12 at 22:04
  • @Jayant Das Thanks for your response. I think the problem as you say in the session. But I do not know how to keep session a live between requests, because every request is done in separate queueable Context – AZIZ Apr 15 at 7:00