You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Johann Ungerer <Jo...@pyrogenesis.co.za> on 2008/03/10 16:50:56 UTC

RE: JBoss Messaging Stomp Configuration

Hi all,

After some fun and games, we managed to configure STOMPConnect to work with JBOSS. Thought I'd share our experience with everyone.

----------------

@echo off
cls
setlocal
title STOMPConnect:61613 - jbosssrv

set uri=tcp://169.254.109.194:61613
set providerurl=jnp://localhost:1099

set classes=stompconnect-1.0.jar;commons-logging-1.1.jar;jboss-messaging.jar;jnpserver.jar;jboss-common.jar;jboss-messaging-client.jar;jbossall-client.jar;jboss-remoting.jar;javassist.jar;jboss-j2ee.jar;trove.jar;jboss-aop-jdk50.jar
set properties=-Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
set properties=%properties% -Djava.naming.provider.url=%providerurl%
set properties=%properties% -Djava.naming.security.principal=guest
set properties=%properties% -Djava.naming.security.credentials=guest

echo Connecting to %providerurl%

java %properties% -classpath %classes% org.codehaus.stomp.jms.Main %uri% ConnectionFactory

--------------

Thanks to the list for the help in getting me on the right road.

Regards,
j/

-----Original Message-----
From: Johann Ungerer [mailto:JohannU@pyrogenesis.co.za]
Sent: 28 February 2008 23:11
To: users@activemq.apache.org
Subject: RE: JBoss Messaging Stomp Configuration

Hi Jim,

Thank you for the reply, its gotten me quite a bit further.

I am currently experiencing a connectivity issue from stomp to JBM, so I'm posting the startup file that I'm using for stomp in hopes that I'm doing something silly. I am able to connect to the JBM via code on the provider url i'm using, so the url "should" be right.

If anyone sees anything obviously wrong, it would be greatly appreciated.

--

set uri=stomp://localhost:61613
set providerurl=tcp://192.168.0.53:1099

set classes=stompconnect-1.0.jar;commons-logging-1.1.jar;jboss-messaging.jar;jnpserver.jar;jboss-common.jar
set properties=-Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
set properties=%properties% -Djava.naming.provider.url=%providerurl%
set properties=%properties% -Djava.naming.security.principal=guest
set properties=%properties% -Djava.naming.security.credentials=guest

echo Connecting to %providerurl%

java %properties% -classpath %classes% org.codehaus.stomp.jms.Main %uri% ConnectionFactory

--

TIA,
j/

-----Original Message-----
From: Jim Gomes [mailto:e.semog@gmail.com]
Sent: 26 February 2008 17:15
To: users@activemq.apache.org
Subject: Re: JBoss Messaging Stomp Configuration

Hi Johann,

It can take a little bit to figure out STOMPConnect, but once you have it
configured, it's very low maintenance.  I had to do something very similar
to what you are attempting to do.  I needed to be able to connect to TIBCO
EMS using the Apache NMS client (this was before direct support was added
for TIBCO).  I used STOMPConnect to be my bridging mechanism.  I ran the
TIBCO server on one machine, the STOMPConnect on a second machine, and my
NMS client on a third machine.  The STOMPConnect portion could actually be
run on any machine.  I created a simple batch file that would run it on a
Windows box.  Essentially, the connection works as follows: The NMS client
connects to STOMPConnect on port 61613.  STOMPConnect translates the STOMP
messages and forwards them as native JMS messages by connecting to TIBCO on
port 7222.  Here's the batch file.  Hopefully, you can take this and
customize it to use the JBOSS Messaging class factory and JMS clients.  No
custom Java coding required.

------------- 8< ----- SNIP ---- 8< ---------

@echo off
cls
setlocal
title STOMPConnect:61613 - jbosssrv

set uri=stomp://localhost:61613
set providerurl=tcp://jbosssrv:7222

set classes=stompconnect-1.0.jar;commons-logging-1.1.jar;jms.jar;tibjms.jar
set properties=-
Djava.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory
set properties=%properties% -Djava.naming.provider.url=%providerurl%
set properties=%properties% -Djava.naming.security.principal=guest
set properties=%properties% -Djava.naming.security.credentials=guest

echo Connecting to %providerurl%

java %properties% -classpath %classes% org.codehaus.stomp.jms.Main %uri%
GenericConnectionFactory

------------- 8< ----- SNIP ---- 8< ---------

You should replace the
com.tibco.tibjms.naming.tibjmsInitialContextFactorywith the
corresponding JBOSS Messaging context factory.  The
tibjms.jar file will be replaced with the JBOSS Messaging client jar file.

Hope this helps you get further.

- Jim

On Mon, Feb 25, 2008 at 8:54 PM, Johann Ungerer <Jo...@pyrogenesis.co.za>
wrote:

> Hi Jim,
>
> Thanks for the reply. I've pretty much gotten that far. The trick I'm not
> able to sort out on my own is actually configuring STOMPConnect to bridge to
> JBM. The documentation is a little patchy, I'm not sure which configs to
> touch, would I run STOMPConnect as a stand-alone product, or can I use the
> "Injection Dependency" mentioned in the docs? I'm comfortable that I'll sort
> the client out, it's the server and bridge config that I'm not too sure of.
>
> TIA,
> j/
>
> -----Original Message-----
> From: Jim Gomes [mailto:e.semog@gmail.com]
> Sent: 25 February 2008 23:50
> To: users@activemq.apache.org
> Subject: Re: JBoss Messaging Stomp Configuration
>
> Hi Johann,
>
> To get the NMS client to talk the stomp protocol, you will need to set
> your
> connection string in one of the following formats.  Either is acceptable,
> so
> it's up to you which one you prefer.
>
> activemq:tcp://jbosssrvr:61613?transport.wireformat=stomp
>      OR
> activemq:stomp://jbosssrvr:61613
>
> The port 61613 is the port that ActiveMQ listens on for STOMP protocol
> messages.  You will need to set the correct port entry for the JBOSS
> Messaging broker.  If JBOSS Messaging does not support STOMP natively, you
> may need to use the STOMPConnect product to bridge between your client and
> JBOSS Messaging.
>
> Good Luck,
> Jim
>
> On Mon, Feb 25, 2008 at 1:06 PM, Johann Ungerer <JohannU@pyrogenesis.co.za
> >
> wrote:
>
> > Hi All,
> >
> > I'm totally new to the entire JMS environment, but am trying to connect
> a
> > .NET Client to a JBOSS Messaging implementation. Thus far I've tried
> with
> > the NMS client, using an OpenWire connector, but I figure this will
> never
> > work.
> >
> > It's been recommended that I use a STOMP connector, but can't quite get
> > either my JBOSS Server configured to listen on STOMP, or get STOMP to
> talk
> > to the JBOSS.
> >
> > Has anyone tried to make a C# client talk to JBOSS and if so, please
> > provide some guidance on what I need to do in order to achieve this.
> >
> > TIA,
> > j/
> >
> >
>

Re: JBoss Messaging Stomp Configuration

Posted by Gregory Mostizky <gr...@gmail.com>.
See this issue at JBoss Jira 
https://jira.jboss.org/jira/browse/JBMESSAGING-1384 JBMESSAGING-1384  for a
solution that allows running StompConnect as JBoss Service. It allows
running StompConnect as JBoss Service in the same JVM. It worked for me with
JBoss 5.0.1 - not sure if other versions work too. 

To use it, just download and unzip the attached file, set your jboss home in
the build.properties and then run the build with ant. After you done that,
find stompservice.sar in the <server-config>/deploy/ directory and put
stompconnect.jar from the zip (not from the codehaus site) inside it at top
level. Then restart your JBoss and voila - StompConnect run automatically as
service inside JBoss JVM. 
-- 
View this message in context: http://www.nabble.com/JBoss-Messaging-Stomp-Configuration-tp15677725p22848408.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: JBoss Messaging Stomp Configuration

Posted by James Strachan <ja...@gmail.com>.
Great stuff! I've added this page to the STOMP wiki
http://docs.codehaus.org/display/STOMP/StompConnect+with+JBoss


On 10/03/2008, Johann Ungerer <Jo...@pyrogenesis.co.za> wrote:
> Hi all,
>
>  After some fun and games, we managed to configure STOMPConnect to work with JBOSS. Thought I'd share our experience with everyone.
>
>  ----------------
>
>
>  @echo off
>  cls
>  setlocal
>  title STOMPConnect:61613 - jbosssrv
>
>
> set uri=tcp://169.254.109.194:61613
>  set providerurl=jnp://localhost:1099
>
>  set classes=stompconnect-1.0.jar;commons-logging-1.1.jar;jboss-messaging.jar;jnpserver.jar;jboss-common.jar;jboss-messaging-client.jar;jbossall-client.jar;jboss-remoting.jar;javassist.jar;jboss-j2ee.jar;trove.jar;jboss-aop-jdk50.jar
>
> set properties=-Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
>  set properties=%properties% -Djava.naming.provider.url=%providerurl%
>  set properties=%properties% -Djava.naming.security.principal=guest
>  set properties=%properties% -Djava.naming.security.credentials=guest
>
>  echo Connecting to %providerurl%
>
>  java %properties% -classpath %classes% org.codehaus.stomp.jms.Main %uri% ConnectionFactory
>
>
> --------------
>
>  Thanks to the list for the help in getting me on the right road.
>
>  Regards,
>
> j/
>
>
>  -----Original Message-----
>  From: Johann Ungerer [mailto:JohannU@pyrogenesis.co.za]
>  Sent: 28 February 2008 23:11
>  To: users@activemq.apache.org
>
> Subject: RE: JBoss Messaging Stomp Configuration
>
>  Hi Jim,
>
>  Thank you for the reply, its gotten me quite a bit further.
>
>  I am currently experiencing a connectivity issue from stomp to JBM, so I'm posting the startup file that I'm using for stomp in hopes that I'm doing something silly. I am able to connect to the JBM via code on the provider url i'm using, so the url "should" be right.
>
>  If anyone sees anything obviously wrong, it would be greatly appreciated.
>
>  --
>
>  set uri=stomp://localhost:61613
>  set providerurl=tcp://192.168.0.53:1099
>
>  set classes=stompconnect-1.0.jar;commons-logging-1.1.jar;jboss-messaging.jar;jnpserver.jar;jboss-common.jar
>  set properties=-Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
>  set properties=%properties% -Djava.naming.provider.url=%providerurl%
>  set properties=%properties% -Djava.naming.security.principal=guest
>  set properties=%properties% -Djava.naming.security.credentials=guest
>
>  echo Connecting to %providerurl%
>
>  java %properties% -classpath %classes% org.codehaus.stomp.jms.Main %uri% ConnectionFactory
>
>  --
>
>  TIA,
>  j/
>
>  -----Original Message-----
>  From: Jim Gomes [mailto:e.semog@gmail.com]
>  Sent: 26 February 2008 17:15
>  To: users@activemq.apache.org
>  Subject: Re: JBoss Messaging Stomp Configuration
>
>  Hi Johann,
>
>  It can take a little bit to figure out STOMPConnect, but once you have it
>  configured, it's very low maintenance.  I had to do something very similar
>  to what you are attempting to do.  I needed to be able to connect to TIBCO
>  EMS using the Apache NMS client (this was before direct support was added
>  for TIBCO).  I used STOMPConnect to be my bridging mechanism.  I ran the
>  TIBCO server on one machine, the STOMPConnect on a second machine, and my
>  NMS client on a third machine.  The STOMPConnect portion could actually be
>  run on any machine.  I created a simple batch file that would run it on a
>  Windows box.  Essentially, the connection works as follows: The NMS client
>  connects to STOMPConnect on port 61613.  STOMPConnect translates the STOMP
>  messages and forwards them as native JMS messages by connecting to TIBCO on
>  port 7222.  Here's the batch file.  Hopefully, you can take this and
>  customize it to use the JBOSS Messaging class factory and JMS clients.  No
>  custom Java coding required.
>
>  ------------- 8< ----- SNIP ---- 8< ---------
>
>  @echo off
>  cls
>  setlocal
>  title STOMPConnect:61613 - jbosssrv
>
>  set uri=stomp://localhost:61613
>  set providerurl=tcp://jbosssrv:7222
>
>  set classes=stompconnect-1.0.jar;commons-logging-1.1.jar;jms.jar;tibjms.jar
>  set properties=-
>  Djava.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory
>  set properties=%properties% -Djava.naming.provider.url=%providerurl%
>  set properties=%properties% -Djava.naming.security.principal=guest
>  set properties=%properties% -Djava.naming.security.credentials=guest
>
>  echo Connecting to %providerurl%
>
>  java %properties% -classpath %classes% org.codehaus.stomp.jms.Main %uri%
>  GenericConnectionFactory
>
>  ------------- 8< ----- SNIP ---- 8< ---------
>
>  You should replace the
>  com.tibco.tibjms.naming.tibjmsInitialContextFactorywith the
>  corresponding JBOSS Messaging context factory.  The
>  tibjms.jar file will be replaced with the JBOSS Messaging client jar file.
>
>  Hope this helps you get further.
>
>  - Jim
>
>  On Mon, Feb 25, 2008 at 8:54 PM, Johann Ungerer <Jo...@pyrogenesis.co.za>
>  wrote:
>
>  > Hi Jim,
>  >
>  > Thanks for the reply. I've pretty much gotten that far. The trick I'm not
>  > able to sort out on my own is actually configuring STOMPConnect to bridge to
>  > JBM. The documentation is a little patchy, I'm not sure which configs to
>  > touch, would I run STOMPConnect as a stand-alone product, or can I use the
>  > "Injection Dependency" mentioned in the docs? I'm comfortable that I'll sort
>  > the client out, it's the server and bridge config that I'm not too sure of.
>  >
>  > TIA,
>  > j/
>  >
>  > -----Original Message-----
>  > From: Jim Gomes [mailto:e.semog@gmail.com]
>  > Sent: 25 February 2008 23:50
>  > To: users@activemq.apache.org
>  > Subject: Re: JBoss Messaging Stomp Configuration
>  >
>  > Hi Johann,
>  >
>  > To get the NMS client to talk the stomp protocol, you will need to set
>  > your
>  > connection string in one of the following formats.  Either is acceptable,
>  > so
>  > it's up to you which one you prefer.
>  >
>  > activemq:tcp://jbosssrvr:61613?transport.wireformat=stomp
>  >      OR
>  > activemq:stomp://jbosssrvr:61613
>  >
>  > The port 61613 is the port that ActiveMQ listens on for STOMP protocol
>  > messages.  You will need to set the correct port entry for the JBOSS
>  > Messaging broker.  If JBOSS Messaging does not support STOMP natively, you
>  > may need to use the STOMPConnect product to bridge between your client and
>  > JBOSS Messaging.
>  >
>  > Good Luck,
>  > Jim
>  >
>  > On Mon, Feb 25, 2008 at 1:06 PM, Johann Ungerer <JohannU@pyrogenesis.co.za
>  > >
>  > wrote:
>  >
>  > > Hi All,
>  > >
>  > > I'm totally new to the entire JMS environment, but am trying to connect
>  > a
>  > > .NET Client to a JBOSS Messaging implementation. Thus far I've tried
>  > with
>  > > the NMS client, using an OpenWire connector, but I figure this will
>  > never
>  > > work.
>  > >
>  > > It's been recommended that I use a STOMP connector, but can't quite get
>  > > either my JBOSS Server configured to listen on STOMP, or get STOMP to
>  > talk
>  > > to the JBOSS.
>  > >
>  > > Has anyone tried to make a C# client talk to JBOSS and if so, please
>  > > provide some guidance on what I need to do in order to achieve this.
>  > >
>  > > TIA,
>  > > j/
>  > >
>  > >
>  >
>


-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com