My ActiveMQ messaging instance (ActiveMQ 5.16.2 on Amazon MQ) uses STOMP. I cannot use the JMS QueueBrowser, and there is no way to "unack" a message. As soon as there is a consumer that pulled that message from the queue i.e. marked as "unconsumed" as stated in the docs here.
Assuming the broker cannot be changed, I was looking at the REST API mapping of JMS here, but I do not see any endpoint that mimic the ActiveMQ admin pages (JSP), that is capable to browse the queue, consumers and message content without actively "pulling" those messages from the queue.
So, how to implement that JMS logic we can see in the ActiveMQ admin pages programmatically (e.g. via REST apis)?
Looking at the docs of REST API, assumed having the logon, this approach works
curl -XGET https://user:pass#server:8162/admin/browse.jsp?JMSDestination=ActiveMQ.DLQ
and it grab the JSP page output as on the web console, so I assume that it could be done via some "official" rest API.
NOTE. The ActiveMQ JSP page is not using any AJAX call, so I assume it is using the JMS Java API directly.
The REST/JMS mapping doesn't offer any message browsing functionality.
However, it's worth noting that the REST/JMS mapping is independent of the management functionality exposed by Jolokia. Jolokia is an HTTP-JMX bridge so anything exposed via JMX can be accessed via HTTP (e.g. using curl). The DestinationViewMBean has various "browse" methods you can use, e.g.:
$ curl -XGET -u admin:admin -H "Origin: http://localhost" http://localhost:8161/api/jolokia/exec/org.apache.activemq:type=Broker,brokerName=localhost,destinationType=Queue,destinationName=TEST/browse\(\)
Where TEST is the name of your queue.
You can get a list of JMX objects using the search command, e.g.:
$ curl -XGET -u admin:admin -H "Origin: http://localhost" http://localhost:8161/api/jolokia/search/org.apache.activemq:*
You can read more about the Jolokia Protocol on their website.
Related
My spring boot application needs to call a third party API to verify an user data. now the API provided from third party, they have some restrictions like they only accept if the request comes from some specific IP.
Now our network consultant has made one of my worker nodes to be able to request this API. I can curl the request to the API and get a proper response. I can deploy my application on that worker node outside of kubernetes using tomcat and get proper response.
But when I deploy it on kubernetes cluster, it does not work. Does not work means that API don't accept/process the request. 503 service not available something like that.
Then I tried to curl the request from inside the pods of worker node and found it does not work.
So, I am guessing my Kubernetes is not using the configuration on the system network.
So is there any way I can make my worker node(even one worker node) to use the system network while calling that or any third party API, as I can see I can request and get proper response from API when I request it outside the cluster but from the worker node pc.
For my deployment I have a number of 3rd party systems that can only send HTTP POST requests with metrics (I need in the queue) and they cannot be re-configured. My goal is to have specific endpoints (or vhosts) that when POST'd to will automatically route to the correct queue, without needing the necessary routing key and other standard rabbitmq JSON data. As this modification is not possible in the 3rd party systems.
I can't find any way to do this natively as of now, but I believe it may be possible to configure a HTTP reverse proxy in the front, whereby any data sent to the specific endpoint, will be re-directed to the correct rabbitMQ HTTP endpoint, where I could then bolt in the nessary JSON data so it can be parsed by rabbitmq and placed in the realvent queue. I wanted to check if this is the only logical solution to this, or am I missing something obvious that can be done within rabbitmq's administration page or via config files.
How to configure WebSphere Liberty v17.x logging feature in order to see in the traces or logs the payload sent and received from a JAX-RS v2.0 call from WebSphere Liberty?
We tried many things including configuring the logging feature like this:
<logging traceSpecification="*=info
:com.ibm.websphere.jaxrs20.=all \
:com.ibm.ws.jaxrs20.=all \
:org.apache.cxf.*=all "/>
but we are still not able to see the payload send and received from JAX-RS calls.
We see lots of internal traces from WAS but no payload/body is visible
The payload/body is usually in JSon marshalled from CXF and jackson, the JAX_RS implementation bundled with liberty.
The Java mapping is done via JAXB annotations in java
I am implementing an application that displays data which is coming from a back end server. The back end server is using WCF for writing web services. I am not familiar with that WCF.
What can I try to resolve this?
If your WCF application is configured to be a SOAP service, then any SOAP libraries for iOS can be used.
You can make HTTP or SOAP requests to WCF. Given an HTTP request, for example, you could test it using cUrl. In it's simplest form, a cUrl get request is as follows:
curl http://stackoverflow.com
You very well may need to make POST or PUT request. If so you can review the docs here: http://curl.haxx.se/docs/httpscripting.html. I've included an example POST request using cUrl:
curl -X POST -H 'Content-type: text/xml' -d <YOUR PAYLOAD HERE> http://stackoverflow/fakepost
There a loads of ways to make HTTP requests, cUrl is just a client for doing so.
The following describes an iOS implementation of a POST request: iOS: how to perform a HTTP POST request? .
We have several WCF services - some with SOAP endpoints and others that with REST endpoints. There are also some services that have both SOAP and REST endpoint (diff. customer specs/demands). So far when it comes to testing, we've written custom test clients from ground up purely for testing the actual service+endpoints. However, I'm not sure if that's the best approach because we also have to maintain the test applications as a separate 'product'.
Is there any recommended approach to formally test these endpoints and services? Hopefully one framework/pattern that can cover both SOAP as well as REST sides.
SoapUI can test both SOAP and REST web services. Check out its other features.
This answer is specific to testing RESTful web services. We use the following tools:
RestClient is a Java application to test RESTful webservices.
curl - Comes in the Cygwin distribution for windows. You can find linux installables for your flavor of linux here. Sample uses of curl to make REST calls:
curl -v http://flickr.com/rogermenezes/photos/61 -H 'Content-Type:application/json' -H 'X-FlickrAPI-Version:1.0' -X DELETE
curl -v http://flickr.com/rogermenezes/albums -H 'Content-Type:application/json' -H 'X- FlickrAPI -Version:1.0' -X POST -d '{"name": "hawaii 2011", "tags": "vacation, hawaii, ", "creation_date": "2012-02-22T13:42Z"}'
Chrome Plugin - Advance REST Client
You can install this plugin through the Chrome Web Store. You can save past requests and the plugin also maintains a history of previous calls you had made.
Fiddler2
Fiddler2 snoops your network traffic. It also provides a way to "reissue and edit" past requests. Here, you can edit your past REST requests and execute them repeatedly.
You can use the headers section to provide security token. Our services are secured and I use SOAPUI to organize tests