I am looking for an example or code snippets on using Spring's STOMP topic pub/sub messaging, with both the client and server in the same tomcat7 instance. NOT OVER THE WEBSOCKET.
We want to handle some operations asynchronously in our server side and so want to use STOMP as our messaging protocol in our tomcat7 instance. Everywhere I look I find samples for STOMP over websocket or integrating with other MOM's!!
Anyone know about a java sample for simple spring stomp pub/sub? Appreciate any pointers...Thanks.
Have a look at the Spring Websocket Portfolio application. Yes, I know you said not over websocket, but the application has some tests that use a STOMP client/server that might just be what you are looking for.
Related
I am currently using Netty integrated WebSocket to do a chat room, I would like to ask whether Netty supports STOMP protocol, so that Netty+ WebSocket + STOMP can be done? I can't find any examples online because the combination doesn't fit the actual development, or because they're the wrong combination?
Netty provides a STOMP codec so in that sense it "supports" STOMP. However, STOMP is a messaging protocol and Netty is not a message broker. Therefore, in that sense Netty doesn't support STOMP. In order to support STOMP as a messaging protocol you'd have to implement much more than what Netty provides. See the STOMP specification for more details on that.
I am working on an NIO SMTP client with Spring Webflux and Reactor Netty. I have a requirement to integrate messaging into the application, and I was wondering if there is a non blocking way to interact with ActiveMQ, the only documentation I found that mentions NIO in ActiveMQ only talks about how the ActiveMQ server uses NIO model, but nothing about consuming the service with a non blocking client.
Sure, ActiveMQ, like any other JMS provider has a blocking API (MessageConsumer.receive()) as well as a method to setup a MessageListener that is called automatically once a message arrives. Since you are using Spring, take a look at this example.
In addition, you can enable server-side NIO with 'nio' instead of the tcp prefix: nio://hostname:port?key=value, see also https://activemq.apache.org/nio-transport-reference, but it sounds like NIO is implemented only the server end of a client-server communication only.
I'm using RabbitMQ, Spring and SockJS.
My app generatea many different messages and posts them to rabbitmq via stomp. This generation requires a lot of resources so I want to know is there any subscriptions to rabbitmq and what kind of subscription it is (I need to know routing keys of this subscriptions) to avoid generating unnecessary messages.
Is there any possibilities to get this information from Spring or any Java client library?
You can find all the information using one or more of the following
command line tool rabbitmqctl
rabbitmq http api
rabbitmq management (web ui)
There is a library to get information from rabbitmq http api https://github.com/rabbitmq/hop
How to Write a Java based Spring Web Socket (STOMP) Client. As in Spring we have only javascript based client is provided using stompJS but if we need a java client how should we need to achive it?
Spring 4.1 introduces a SockJs Java Client which is quite useful for server to server communication and performance testing. It doesn't come with a Stomp client (this is certainly in the roadmap) but you can check out the tests in the sample app which has already an implementation. Seems this is what you are looking for.
Update 8 Sep 2015:
Spring 4.2 has a STOMP Java client which can be used along with the SockJS Java client. More: https://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/htmlsingle/#websocket-stomp-client
I would look for websocket clients in Java and build off of those. It seems that Jetty has a websocket client api as does too tall nate.
I know JMS and PHP don't get along very easily. I'm in a project where we need to read a jms bus to extract some information using PHP (imagine a java backend application putting messages on the jms buss (using openmq) and a php frontend application that needs to read those messages).
I've tried PHPMQ with no success and I'm wondering if some one else has a suggestion?
Thanks!
Ivan
ActiveMQ supports JMS for PHP through the Stomp Protocol.