user3448119
user3448119

Reputation: 107

can we use non java for consuming JMS messages

I understand Java JMS API provides the support for producing and consuming messages asynchronously.

For example, I will implement JMS producer using java and send messages to the JBOSS Message(Destination).

let say the external application say .net applicationin the distributed environment want to consume the messages by connecting to the JBOSS Message(Destination)

Is that possible?

Upvotes: 4

Views: 1079

Answers (4)

rü-
rü-

Reputation: 2312

JMS only defines the API an application can use to send and receive messages. It doesn't define a wire format. So it depends on the messaging system you use. JBoss uses HornetQ (since JBoss 6, IIRC), and HornetQ supports other wire formats, namely STOMP and AMQP. It also allows to use REST to send and receive messages.

But, as it is so often the case with interoperability, you'll have to limit yourself for this to actually work. You can't exchange all message bodies (as EJP has elucidated) and probably not all message headers and properties.

Upvotes: 2

user207421
user207421

Reputation: 310860

There are several JMS message types:

  • BytesMessage: can be read by anybody
  • TextMessage: ditto
  • StreamMessage: can be read by anybody who can read network-ordered primitive types
  • ObjectMessage: these are serialized objects and can only be read by Java
  • MapMessage: these are essentially maps; ditto

JMS itself isn't a message broker, just an API to an existing broker.

If your Java code and the non-Java code can agree on a byte- or text-based message format, you can interchange message between them.

Upvotes: 4

on a technical level any message over a protocol can be read regardless of message since its all converted to 0's and 1's at some point. However, because JMS are java interfaces you technically wont be using JMS even if you read the messages that way - JMS is the java way to read those messages by using java JMS interfaces and classes that extend those interfaces

Upvotes: 0

SJuan76
SJuan76

Reputation: 24780

Reading a book about it at the moment.

You will need a JMS server that can be accessed through .Net services (either directly or because your JMS can be configured to send the messages to a .Net MOM *).

In any case, it would not be part of JMS but a capability of a particular product. JMS was developed with the intention of being "generic enough" to work in this scenario, but it is up to the specific server implementation (and configuration) to support it (or not).

  • MOM: Message Oriented Middleware

Upvotes: 0

Related Questions