Can we send messages between two clients using different protocols(STOMP - TCP) with ActiveMQ? - jms

I have a scenario , where i have my sender code written in Node.js which uses STOMP protocol to publish it to the destination(queue) and the receiver code written in java which use TCP protocol to receive the message from the destination(queue) through ActiveMQ server.Will it be possible for the clients(sender/receiver) to communicate? or it should be the same protocol at either end?

The ActiveMQ documentation covers this on the Stomp page (http://activemq.apache.org/stomp.html) in the paragraphs
Working with JMS Text/Bytes Messages and Stomp
Message transformations
Stomp extensions for JMS message semantics
ActiveMQ extensions to Stomp
ActiveMQ supports richt message conversion between messages from different protocols. Not all multi-protocol have this feature, for example ActiveMQ Apollo (issue 267).

Not an issue. ActiveMQ acts as a multiprotocol message exchange so messages received by the broker in any supported protocol can in turn be sent to receivers in any other supported protocol.

Related

Is the Solace message broker compatible with "regular" AMQP or JMS clients?

I'd like to use regular AMQP or JMS clients to connect to a Solace message broker but don't know enough about these protocols to know if they are compatible. From what I can tell Solace implements AMQP and JMS bu possibly with incompatible extensions (e.g. "message vpn").
Does Solace have incompatible extensions, particularly for JMS, or is there a straightforward way to get a JMS client to speak to a Solace broker with "message vpn" enabled?
The choice is yours as Solace provides both a JMS client implementation and it also supports AMQP 1.0.
Keep in mind that JMS is an API and AMQP is a protocol. The JMS API can be implemented over any suitable wire protocol, and AMQP can be exposed via any suitable API. JMS is Java-based and there are many JMS implementations using different protocols under the covers. There are also many AMQP clients written in different languages on different platforms all with different APIs. There are even projects which combine both JMS and AMQP like Qpid JMS.
Solace's PubSub+ event broker works on binary payloads which means that you can indeed publish and consume messages on cross protocols and APIs.
The Solace APIs have detailed documentation on how to process the payload in a type agnostic fashion.
As you can see in this diagram, we support a wide range of APIs and protocol integrations.
There are also sample codes present over at this Github account listing examples on using Solace broker with JMS and AMQP : https://github.com/SolaceSamples?
(Answering my own question).
I basically wanted to know if it was possible to connect to a Solace/JMS broker using more popular messaging libraries. As far as I can tell the answer is no in general.
For example,
one feature of JMS is JNDI lookup of the InitialContextFactory. I don't think that is possible to do outside of a JMS library.

Bridge between two WebSocket STOMP servers

We have an ActiveMQ server and our own API with WebSocket/STOMP service endpoint.
Is there a way to configure ActiveMQ to connect and subscribe to a topic in our API and then publish the messages in ActiveMQ?
If not, are there any other WebSocket/STOMP bridge components which could be used to achieve the same thing (subscribe to a topic in our API and post messages to a topic in ActiveMQ)?
The motivation of all this is... complicated.
ActiveMQ natively supports Camel routes. You could potentially use Camel's STOMP component to subscribe to your own STOMP endpoint and then send those messages to a local destination.

How to receive message published on a topic using mqtt protocol in spring:jms application?

I am new to activemq.
I have a publisher which publish a message to a topic using mqtt protocol. And now I want to write a subscriber using Spring + JMS which will listen for the message on that topic.
I have following questions:
1) Can I have a same topic if I write the subscriber using tcp protocol.I mean to say, publisher will use MQTT to publish on a topic and subscriber will listen on that topic using TCP broker URL.
2) If above is not possible then how can I write a subscriber using spring + jms that will listen and receive the messages published on the topic using mqtt ?
Thank you in advance.
Did you even try? Yes, it works pretty much as you expect it to. MQTT msgs gets converted to JMS if you try read it with JMS (OpenWire).
From web site:
Message transformations
MQTT messages are transformed into an JMS
ByteMessage. Conversely, the body of any JMS Message is converted to a
byte buffer to be the payload of an MQTT message.

AMQP & Openwire - Activemq broker and 2 different consumers

I have an activeMQ broker that supports both amqp and openwire.
Is it possible that a producer of openwire (tcp, port 61616) will produce to a queue that have a consumer that uses amqp protocol instead?
or am i limited to the same protocol consumers&producers only?
Yes, it is possible to interoperate with the OpenWire JMS client and an AMQP client using ActiveMQ. The destinations that hold the messages are not separate spaces therefore message place on a Queue by a client of one type are consumable by a client from some other protocol.
The only thing that you have to contend with is how the actual messages are conveyed to each client. ActiveMQ provides a configurable transfomer that can either preserve the original bytes of the AMQP message when sent from an AMQP client or transform that message into a more JMS style message object that would be received by the OpenWire client as the expected type (TextMessage, BytesMessage, MapMessage...).
Refer to the documentation of ActiveMQ for help in configuration and in understanding the mappings of AMQP to OpenWire messages.
http://activemq.apache.org/amqp.html
If you want to easiest to handle scenario where messages are transformed and always arrive at the OpenWire client as proper JMS types choose the JMS Transformer in configuration like so:
<transportConnector name="amqp" uri="amqp://localhost:5672?transport.transformer=jms"/>

How does the JMS API work with ActiveMQ

NEWBIE Question here, maybe I am way off...
When I send a JMS text message to an ActiveMQ topic using the activemq-all jar, is a JMS message actually sent over the wire, or does ActiveMQ actually map/transform the message to pure AMQP?
Thanks.
JMS is an API specification and not a wire level protocol specification. It defines a set of APIs a Messaging provider must implement to call the messaging provider a JMS provider. How the JMS APIs are implemented is internal to the implementer. ActiveMQ might(or does) use AMQP protocol under the hood to implement JMS APIs. Others, for example, IBM MQ uses it's own proprietary protocol.

Resources