Re: [activemq-user] Bridge ActiveMQ and other messaging system

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [activemq-user] Bridge ActiveMQ and other messaging system

jstrachan

On 13 Jun 2005, at 20:39, pat wrote:
> We are trying to provide a JMS interface for our properitary  
> messaging system.
> We thought we may achieve this by extending ActiveMQ.
>
> Just wonder if ActiveMQ has a plugin facility so we can plugin our  
> "proxy"?

Sure

> If
> not, we have to modify the source code. If that's case, where's the  
> best place
> to start with?

The simplest way to plugin a foreign messaging system is to write a  
TransportChannel implementation. We use discovery using META-INF/
services/* text files to auto-discover implementations at runtime -  
so its designed so that you can write other transports / wire  
protocols and drop them in.

http://activemq.codehaus.org/Protocols

So implement a TransportChannel, by deriving from  
TransportChannelSupport (or TcpChannelSupport if its TCP based) and  
then implement a TransportChannelFactory

http://activemq.codehaus.org/checkout/activemq/modules/core/src/java/ 
org/activemq/transport/TransportChannel.java

then you just need to accept and generate the various commands the  
JMS client uses for ConnectionInfo, SessionInfo, ConsumerInfo,  
ProducerInfo and the MessageAck / ActiveMQMessage objects.
http://activemq.codehaus.org/Wire+Protocol

James
-------
http://radio.weblogs.com/0112098/

Reply | Threaded
Open this post in threaded view
|

RE: [activemq-user] Bridge ActiveMQ and other messaging system

Max Kington
It's also perhaps mentioning that if you're in a position to write Java
code that can be called from your messaging system your life would be a
heck of a lot easier.  You can write a consumer/producer to shunt
messages between them.  

Don't forget transactiony goodness there either,

Max
-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
Sent: 14 June 2005 14:43
To: [hidden email]
Subject: Re: [activemq-user] Bridge ActiveMQ and other messaging system


On 13 Jun 2005, at 20:39, pat wrote:
> We are trying to provide a JMS interface for our properitary  
> messaging system.
> We thought we may achieve this by extending ActiveMQ.
>
> Just wonder if ActiveMQ has a plugin facility so we can plugin our  
> "proxy"?

Sure

> If
> not, we have to modify the source code. If that's case, where's the  
> best place
> to start with?

The simplest way to plugin a foreign messaging system is to write a  
TransportChannel implementation. We use discovery using META-INF/
services/* text files to auto-discover implementations at runtime -  
so its designed so that you can write other transports / wire  
protocols and drop them in.

http://activemq.codehaus.org/Protocols

So implement a TransportChannel, by deriving from  
TransportChannelSupport (or TcpChannelSupport if its TCP based) and  
then implement a TransportChannelFactory

http://activemq.codehaus.org/checkout/activemq/modules/core/src/java/ 
org/activemq/transport/TransportChannel.java

then you just need to accept and generate the various commands the  
JMS client uses for ConnectionInfo, SessionInfo, ConsumerInfo,  
ProducerInfo and the MessageAck / ActiveMQMessage objects.
http://activemq.codehaus.org/Wire+Protocol

James
-------
http://radio.weblogs.com/0112098/


________________________________________________________________________
In order to protect our email recipients, Betfair use SkyScan from
MessageLabs to scan all Incoming and Outgoing mail for viruses.

________________________________________________________________________

Reply | Threaded
Open this post in threaded view
|

[activemq-user] Re: Bridge ActiveMQ and other messaging system

pat-3
In reply to this post by jstrachan

Thanks for the reply.

And what if I implements all the interfaces defined in org.activemq.broker.
Will my implementation work with the rest of the components?

Pat




Reply | Threaded
Open this post in threaded view
|

Re: [activemq-user] Re: Bridge ActiveMQ and other messaging system

jstrachan
On 14 Jun 2005, at 21:02, pat wrote:
> Thanks for the reply.
>
> And what if I implements all the interfaces defined in  
> org.activemq.broker.
> Will my implementation work with the rest of the components?

Sure.

The TransportChannel is used in the JMS client to talk to the broker,  
and by the broker to talk to the clients that are connected to it. So  
rather than implementing a broker, you could reuse the existing  
broker and just write a new transport. (e.g. we have  a Jabber  
transport that folks can talk pure Jabber over to our broker which  
can then route to regular JMS clients etc).

However if you are trying to bridge to another messaging system, you  
probably don't need to go to all the trouble of writing a new broker  
- just write a transport (which are fairly straight forward - ideally  
all a transport does is take the Packet objects and marshal them into  
some kinda protocol - then read them and notify the PacketListener.

James
-------
http://radio.weblogs.com/0112098/

Reply | Threaded
Open this post in threaded view
|

[activemq-user] Re: Bridge ActiveMQ and other messaging system

pat-3
>
> However if you are trying to bridge to another messaging system, you  
> probably don't need to go to all the trouble of writing a new broker  
> - just write a transport (which are fairly straight forward - ideally  
> all a transport does is take the Packet objects and marshal them into  
> some kinda protocol - then read them and notify the PacketListener.
>

Then how a JMS client express its interest in certain messages (identified by
the selector) in abother messaging system. For example, a JMS client is
interested in certain XML doc, it uses message selector syntax to express it.
Ideally, when this "interest" is propagate into our messaging system, we
convert it into XPath and filtering XML doc based on it. I wonder how to solve
this problem by just implementing TransportProtocol.

Thanks,
Pat



Reply | Threaded
Open this post in threaded view
|

Re: [activemq-user] Re: Bridge ActiveMQ and other messaging system

chirino
Hi Pat,

I think what james is trying to say is, that if you implement a  
transport then you can talk to your existing messaging system in it's  
native communications protocol.  Now, if the messaging system does  
not support selectors, then either the client will not able to  
support selectors or you have to add selector support to the  
messaging system.

Does your messaging system support most of the JMS concepts?

Regards,
Hiram


On Jun 15, 2005, at 1:28 PM, pat wrote:

>>
>> However if you are trying to bridge to another messaging system, you
>> probably don't need to go to all the trouble of writing a new broker
>> - just write a transport (which are fairly straight forward - ideally
>> all a transport does is take the Packet objects and marshal them into
>> some kinda protocol - then read them and notify the PacketListener.
>>
>>
>
> Then how a JMS client express its interest in certain messages  
> (identified by
> the selector) in abother messaging system. For example, a JMS  
> client is
> interested in certain XML doc, it uses message selector syntax to  
> express it.
> Ideally, when this "interest" is propagate into our messaging  
> system, we
> convert it into XPath and filtering XML doc based on it. I wonder  
> how to solve
> this problem by just implementing TransportProtocol.
>
> Thanks,
> Pat
>
>
>

Reply | Threaded
Open this post in threaded view
|

[activemq-user] Re: Bridge ActiveMQ and other messaging system

jstrachan
In reply to this post by pat-3
pat wrote:

>>However if you are trying to bridge to another messaging system, you  
>>probably don't need to go to all the trouble of writing a new broker  
>>- just write a transport (which are fairly straight forward - ideally  
>>all a transport does is take the Packet objects and marshal them into  
>>some kinda protocol - then read them and notify the PacketListener.
>>
>
>
> Then how a JMS client express its interest in certain messages (identified by
> the selector) in abother messaging system. For example, a JMS client is
> interested in certain XML doc, it uses message selector syntax to express it.
> Ideally, when this "interest" is propagate into our messaging system, we
> convert it into XPath and filtering XML doc based on it. I wonder how to solve
> this problem by just implementing TransportProtocol.

BTW ActiveMQ 3.1 (and 3.1-M3) has XPath support in selectors for any JMS
messages on the ActiveMQ message bus.

James
-------
http://radio.weblogs.com/0112098/