You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by ldangelo <ld...@mac.com> on 2006/07/17 03:46:24 UTC

sending stomp messages to activemq client

Hi All,

I'm a relatively new activeMQ user...  I am  working on a mysql user defined
function that will send out a jms message.  I intend to use this inside of 
triggers...  so when  new record is inserted I will publish a message and
process the record with activemq/servicemix....

Here is my question:

I have the udf working and publishing  stomp messages (I can see the stomp
messages queued up using the command line tools)...  My activemq clients
never receive the messages.  Do I need to "bridge" stomp and activemq? (I
think I do?)  

Do any of you have an example configuration that I can leverage? 

BTW)  If there is interest in this user defined function I am happy to
share!

-Leo
-- 
View this message in context: http://www.nabble.com/sending--stomp-messages-to-activemq-client-tf1952557.html#a5354577
Sent from the ActiveMQ - User forum at Nabble.com.


Re: sending stomp messages to activemq client

Posted by ldangelo <ld...@mac.com>.
Nevermind that's what the consumertool does...  DOH!

-LeoD
-- 
View this message in context: http://www.nabble.com/sending--stomp-messages-to-activemq-client-tf1952557.html#a5362474
Sent from the ActiveMQ - User forum at Nabble.com.


Re: sending stomp messages to activemq client

Posted by James Strachan <ja...@gmail.com>.
On 7/17/06, ldangelo <ld...@mac.com> wrote:
>
> Thanks a lot...
>
> I will try your suggestion.
>
> BTW)  I'm an experienced TibCo developer/user... with tibco they provide a
> command line utility called rvlisten that will listen to any subject that
> you provide on the command line and output it to the console...
>
> Is there any similar tool for activemq?

The consumer example consumer program that comes with the binary
distro does a similar thing.

You can also use the command line arguments to browse queues...
http://incubator.apache.org/activemq/activemq-command-line-tools-reference.html

or JMX / jconsole...
http://incubator.apache.org/activemq/jmx.html

or the web console...
http://incubator.apache.org/activemq/web-console.html

another option is just to telnet in to the stomp port and CONNECT,
then type in a SUBSCRIBE statement in telnet...

http://stomp.codehaus.org/Protocol
>
> -LeoD
> --
> View this message in context: http://www.nabble.com/sending--stomp-messages-to-activemq-client-tf1952557.html#a5362450
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 

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

Re: sending stomp messages to activemq client

Posted by ldangelo <ld...@mac.com>.
Thanks a lot...

I will try your suggestion.  

BTW)  I'm an experienced TibCo developer/user... with tibco they provide a
command line utility called rvlisten that will listen to any subject that
you provide on the command line and output it to the console...

Is there any similar tool for activemq?

-LeoD
-- 
View this message in context: http://www.nabble.com/sending--stomp-messages-to-activemq-client-tf1952557.html#a5362450
Sent from the ActiveMQ - User forum at Nabble.com.


Re: sending stomp messages to activemq client

Posted by James Strachan <ja...@gmail.com>.
On 7/18/06, ldangelo <ld...@mac.com> wrote:
>
> The version I had problems with was 4.0-RC2.

Ah cool - thanks for the heads up

> As soon as I tidy up the udf, create at least a readme and tidy the makefile
> I will be happy to contribute...

Great! :)

> This is actually a very powerful combination... my mind is realing with the
> possibilities...

Agreed - me too :). (Am also wondering how easy it'd be to replicate
what you've done on other databases too).


> I'll let you know when I figure out the servicemix issue...  Thanks again...

Great!
-- 

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

Re: sending stomp messages to activemq client

Posted by James Strachan <ja...@gmail.com>.
On 7/18/06, ldangelo <ld...@mac.com> wrote:
>
> Holy Moly!  It works! ;^)  I had changed the brokerURL from
> tcp://localhost:61616 to stomp://localhost:61613 in my servicemix.xml
> file... once I switched it back it all works....
>
> The solution I have fires a trigger on insert of a new website registration,
> the trigger sends an activemq message to servicemix, servicemix then
> utilizes drools to determine if the user requires an e-mail response....  if
> so it uses servicemix's smtp integration to send a personalized e-mail...

Awesome! :)

> Thank you soooo much!

Glad its working for you :)


> P.S.  If I can return the favor let me know!  Look for my contribution in
> the next couple of days!

Will do!
-- 

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

Re: sending stomp messages to activemq client

Posted by ldangelo <ld...@mac.com>.
Holy Moly!  It works! ;^)  I had changed the brokerURL from
tcp://localhost:61616 to stomp://localhost:61613 in my servicemix.xml
file... once I switched it back it all works....

The solution I have fires a trigger on insert of a new website registration,
the trigger sends an activemq message to servicemix, servicemix then
utilizes drools to determine if the user requires an e-mail response....  if
so it uses servicemix's smtp integration to send a personalized e-mail...

Thank you soooo much!

-Leo

P.S.  If I can return the favor let me know!  Look for my contribution in
the next couple of days!

-- 
View this message in context: http://www.nabble.com/sending--stomp-messages-to-activemq-client-tf1952557.html#a5372154
Sent from the ActiveMQ - User forum at Nabble.com.


Re: sending stomp messages to activemq client

Posted by ldangelo <ld...@mac.com>.
The version I had problems with was 4.0-RC2.

As soon as I tidy up the udf, create at least a readme and tidy the makefile
I will be happy to contribute...

This is actually a very powerful combination... my mind is realing with the
possibilities...

I'll let you know when I figure out the servicemix issue...  Thanks again...


-LeoD
-- 
View this message in context: http://www.nabble.com/sending--stomp-messages-to-activemq-client-tf1952557.html#a5372078
Sent from the ActiveMQ - User forum at Nabble.com.


Re: sending stomp messages to activemq client

Posted by James Strachan <ja...@gmail.com>.
On 7/18/06, ldangelo <ld...@mac.com> wrote:
>
> Ok,
>
> After tons of debugging here is what I found out...   there is a version of
> activemq which does not send the null character when replying to the stomp
> connect command...  This caused my user defined function to hang for ever
> waiting for the reply...
>
> I switch to incubator-activemq-4.0 and this particular problem went away.

BTW which version were you using before? Incidentally I recommend
4.0.1 at least. We've fixed a few more Stomp related issues post-4.0.1
so you could try 4.1-SNAPSHOT until 4.1 or 4.0.2 go out


> Once past this particular issue I found some other bugs in my user defined
> function...  I fixed these and successfully sent a stomp message from a
> database trigger to the ConsumerTool (listening on tcp://localhost:61616)...
> essentially proving that the udf works with activemq!  Step one complete....

YAY! Nicely done! Am looking forward to your patch :)
http://incubator.apache.org/activemq/contributing.html


> Next I configured a servicemix instance to listen to a topic and trace the
> output... no joy... there is something amiss with my servicemix/activemq
> configuration...
>
> Any advise?

Are you 100% sure that you are using the exact same destination name
and type (e.g. are you sending to a queue and consuming on a topic?).
If the ConsumerTool is receiving your message then the Stomp &
ActiveMQ stuff is all working fine - so its maybe worth sending a mail
to the ServiceMix user list with details of your ServiceMix
configuration to see if others can spot the problem.


> BTW)  Thanks a TON for all of your help so far!

You're most welcome!

-- 

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

Re: sending stomp messages to activemq client

Posted by ldangelo <ld...@mac.com>.
Ok, 

After tons of debugging here is what I found out...   there is a version of
activemq which does not send the null character when replying to the stomp
connect command...  This caused my user defined function to hang for ever
waiting for the reply...

I switch to incubator-activemq-4.0 and this particular problem went away. 
Once past this particular issue I found some other bugs in my user defined
function...  I fixed these and successfully sent a stomp message from a
database trigger to the ConsumerTool (listening on tcp://localhost:61616)...
essentially proving that the udf works with activemq!  Step one complete....

Next I configured a servicemix instance to listen to a topic and trace the
output... no joy... there is something amiss with my servicemix/activemq
configuration...

Any advise?

BTW)  Thanks a TON for all of your help so far!

-- 
View this message in context: http://www.nabble.com/sending--stomp-messages-to-activemq-client-tf1952557.html#a5371933
Sent from the ActiveMQ - User forum at Nabble.com.


Re: sending stomp messages to activemq client

Posted by James Strachan <ja...@gmail.com>.
On 7/17/06, ldangelo <ld...@mac.com> wrote:
>
> James,
>
> Thank you for the reply.
>
> I can see the messages using jconsole, however the servicemix destination
> does not receive the message.

Maybe its a destination issue - you are sending to the wrong
destination for the servicemix destination to receive? e.g. try using
a JMS consumer first - such as the hello world producer/consumer
examples that ship with ActiveMQ. Once you've verified that your
messages work and you can consume them, then look at what your
servicemix configuration is consuming from etc.


> My activemq.xml config file has two transports:
>
> <transportConnectors>
>      15        <transportConnector uri="tcp://localhost:61616"
> discoveryUri="multicast://default"
>      15 />
>      16        <transportConnector name="stomp"
> uri="stomp://localhost:61613"/>
>      17
>      18     </transportConnectors>
>
> my stomp client is connecting to localhost:61613...  Is that right? My java
> client connects to 61616?  How does activemq "know" how to route messages
> back and forth from 61613 to 61616?

Yes. All <transportConnector> connect to the same broker and messages
can flow bidirectionally over any of them

-- 

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

Re: sending stomp messages to activemq client

Posted by ldangelo <ld...@mac.com>.
James, 

Thank you for the reply.

I can see the messages using jconsole, however the servicemix destination
does not receive the message.

My activemq.xml config file has two transports:

<transportConnectors>
     15        <transportConnector uri="tcp://localhost:61616"
discoveryUri="multicast://default"
     15 />
     16        <transportConnector name="stomp"  
uri="stomp://localhost:61613"/>
     17 
     18     </transportConnectors>

my stomp client is connecting to localhost:61613...  Is that right? My java
client connects to 61616?  How does activemq "know" how to route messages
back and forth from 61613 to 61616?

Thanks for any help!

-Leo


-- 
View this message in context: http://www.nabble.com/sending--stomp-messages-to-activemq-client-tf1952557.html#a5361397
Sent from the ActiveMQ - User forum at Nabble.com.


Re: sending stomp messages to activemq client

Posted by James Strachan <ja...@gmail.com>.
On 7/17/06, ldangelo <ld...@mac.com> wrote:
>
> Hi All,
>
> I'm a relatively new activeMQ user...  I am  working on a mysql user defined
> function that will send out a jms message.  I intend to use this inside of
> triggers...  so when  new record is inserted I will publish a message and
> process the record with activemq/servicemix....

Cool! :)

> Here is my question:
>
> I have the udf working and publishing  stomp messages (I can see the stomp
> messages queued up using the command line tools)...  My activemq clients
> never receive the messages.  Do I need to "bridge" stomp and activemq? (I
> think I do?)

No, so long as the messages are received by the broker (and you can
see them via JMX for example or browse them with the web console) then
you're all set. Once a message is received by a broker it can be
consumed over any protocol or language client.

Does the message appear OK on a queue in JMX / web console? If so it
should be consumable by  any Java/Stop client.

BTW in Stomp you use the destination /queue/FOO.BAR whereas in Java
you subscribe to queue FOO.BAR


> BTW)  If there is interest in this user defined function I am happy to
> share!

Great!

-- 

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