You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by HellKnight <he...@foxmail.com> on 2014/02/11 08:49:01 UTC

How can I call REST API for brokerMbean.getQueues() and queueViewMbean.removeMatchingMessage(java.lang.string) in c# ?

I think the subject itself explains my problem pretty good. Thanks very much
for any help. Really getting into trouble to find solutions today.



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-can-I-call-REST-API-for-brokerMbean-getQueues-and-queueViewMbean-removeMatchingMessage-java-lang-tp4677762.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How can I call REST API for brokerMbean.getQueues() and queueViewMbean.removeMatchingMessage(java.lang.string) in c# ?

Posted by HellKnight <he...@foxmail.com>.
Still confused but thanks anyway.I should try it.



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-can-I-call-REST-API-for-brokerMbean-getQueues-and-queueViewMbean-removeMatchingMessage-java-lang-tp4677762p4677768.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How can I call REST API for brokerMbean.getQueues() and queueViewMbean.removeMatchingMessage(java.lang.string) in c# ?

Posted by kimmking <ki...@gmail.com>.
1. use WebRequest  to access http://localhost:8161/admin with credentials to
login,(you can post a form request to http://localhost:8161/hawtio/#/login
instead),
2. keep your WebRequest with cookieContainer of previous request
3. then access jolokia rest api



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-can-I-call-REST-API-for-brokerMbean-getQueues-and-queueViewMbean-removeMatchingMessage-java-lang-tp4677762p4677845.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How can I call REST API for brokerMbean.getQueues() and queueViewMbean.removeMatchingMessage(java.lang.string) in c# ?

Posted by HellKnight <he...@foxmail.com>.
Hi kimmking:
   I could access the urls you provider in my chrome browser, they give me
correct responses. However, I write a sample c# program to access these uri
, I get "403 forbidden" error. I think I should "log in" in my program , as
I log in to hawtio in my browser. How can I do that in c#? I try the
following way:

        NetworkCredential nc = new NetworkCredential("user", "password");
        request.Credentials = nc;
However it did not work. Thanks for your patience and help!




--
View this message in context: http://activemq.2283324.n4.nabble.com/How-can-I-call-REST-API-for-brokerMbean-getQueues-and-queueViewMbean-removeMatchingMessage-java-lang-tp4677762p4677776.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How can I call REST API for brokerMbean.getQueues() and queueViewMbean.removeMatchingMessage(java.lang.string) in c# ?

Posted by kimmking <ki...@gmail.com>.
1. 
http://localhost:8161/hawtio/jolokia/read/org.apache.activemq:brokerName=localhost,type=Broker/Queues

2.
http://localhost:8161/hawtio/jolokia/exec/org.apache.activemq:type=Broker,brokerName=localhost,destinationType=Queue,destinationName=a/removeMatchingMessages(java.lang.String)/type='1'



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-can-I-call-REST-API-for-brokerMbean-getQueues-and-queueViewMbean-removeMatchingMessage-java-lang-tp4677762p4677764.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.