activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Mats.Henrik...@sungard.com>
Subject right way to send and receive messages in a BrokerPlugin
Date Mon, 03 Aug 2009 18:50:42 GMT
Hey,

I'm writing a special broker plugin that makes it so that a client can
only have a single login (per username) to a network of brokers at any
one time. To do this I am making the plugin send a message to all the
other instances of the plugin on the network of brokers (using a topic)
and if they have the user logged in they kick them off.

To do this though I need the plugin to subscribe as a producer and
consumer on my special topic, and I'm having some trouble. Is there a
right way to do this?

I've seen how the AdvisoryBroker and BrokerSupport send messages, is
that the way to do it? I can't seem to find any code that actually works
like a consumer though and receives messages on the ActiveMQ.Advisory
topics, I assume they exist? Basically, what is the right way for a
BrokerPlugin to send and receive messages in their implementation
methods?

Currently I am actually calling BrokerFilter.getVmConnectorUri() when my
plugin is instantiated, appending "?waitForStart=60000&create=false" to
the URI and then creating a new ActiveMQConnectionFactory from that, and
then creating a consumer and a producer sessions and threads. However
I'm having some trouble with the new VM broker it starts, so I was
hoping there might be a better way.

--
Mats Henrikson
Software Engineer
SunGard Kiodex

Think before you print



Mime
View raw message