Has anyone had any luck scripting inserts of ActiveMQ topics using, say, curl?
I’m trying something like this
curl -d "JMSDestination=COMMON_TOPIC&JMSDestinationType=topic&JMSMessageCount=1&JMSText={\"name\":\"values-etc\"}}" http://localhost:8161/admin/sendMessage.action
I get back HTTP 500 NullPointerException which looks like AMQ-2740
java.lang.NullPointerException
at org.apache.activemq.web.handler.BindingBeanNameUrlHandlerMapping.getHandlerInternal(BindingBeanNameUrlHandlerMapping.java:57)
Looks like the problem is generating a secret key and the re-sending it, which is where I get lost. Anyone had luck with this?
This will work for BASIC HTTP authentication and ActiveMQ 5.4.2.
As you said, you must include the secret key, as well as maintaining your java session.
Let’s get the secret key in a SECRET variable and save cookies file (for JSESSIONID).
The Authorization header contains a hash of your credentials, you can sniff yours within the actual web console and a web development tool (F12 in chome).
Send your message by reusing cookies and SECRET
Please note that 5.8 has a RESTful api that should be priviliged.