0

I can send a message from Oracle UTL_HTTP to ActiveMQ Classic using Rest API, but how can I add some properties to my message ?

myMessage := 'some text ....';
req := UTL_HTTP.BEGIN_REQUEST(lc_baseurl, method=>'POST');
UTL_HTTP.SET_HEADER(req, 'User-Agent', 'Mozilla/4.0');
UTL_HTTP.SET_HEADER(req, 'content-type', 'application/json');
utl_http.set_header(req, 'Content-Length', length(myMessage));
utl_http.set_header(req, 'Authorization', 'Basic ....');
utl_http.set_header(req, 'APPLICATION_SOURCE', 'mySource');
UTL_HTTP.WRITE_TEXT (req, myMessage);
resp := UTL_HTTP.GET_RESPONSE(req);

but I cannot see anywhere in the headers or the properties of the message my 'APPLICATION_SOURCE' value. I verified in the amq web console and with some tools like JMSToolbox. I can see the system headers that AMQ has set (jmsmessageID, jmsexpiration ... ) but not mine. And the "Properties" attribute is empty as well.

enter image description here

1
  • I verified in the amq web console and with some tools like JMSToolbox. I can see the system headers that AMQ has set (jmsmessageID, jmsexpiration ... ) but not mine. And the "Properties" attribute is empty as well Commented Dec 9, 2024 at 16:10

1 Answer 1

0

Finally I found the answser : thoses message headers have to be set as URL parameters, not HTTP headers. In my example :

http_req := UTL_HTTP.BEGIN_REQUEST(url => 'http://....:8161/api/message/MyQUEUE?type=queue&APPLICATION_SOURCE=GNX',METHOD => 'POST');

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.