-
1. Re: Example on how to connect to a remote HornetQ topic from an MDB
ravi.teja May 28, 2014 10:48 AM (in response to cremersstijn)Hi
In standalone.xml there is subsystem called messaging. See the below code .
Standalone hornetq configuration with jboss as 7
1) Add or Replace the below code in jboss standalone-full.xml
under <subsystem xmlns="urn:jboss:domain:messaging:1.1"> subsystem tag
Hornetq-Configuaration12
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<hornetq-server><persistence-enabled>true</persistence-enabled><journal-file-size>102400</journal-file-size><journal-min-files>2</journal-min-files><connectors><connectorname="netty"socket-binding="messaging"><factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class><!–This connecting for remote hornetq server if localhost it is not required --><paramkey="host"value="<host-name>"/><paramkey="port"value="<hornetq-port-number>"/></connector></connectors><jms-connection-factories><connection-factoryname="RemoteConnectionFactory"><connectors><connector-refconnector-name="netty"/></connectors><entries><entryname="RemoteConnectionFactory"/></entries></connection-factory><pooled-connection-factoryname="hornetq-ra"><transactionmode="xa"/><connectors><connector-refconnector-name="netty"/></connectors><entries><entryname="java:/JmsXA"/></entries></pooled-connection-factory></jms-connection-factories></hornetq-server>2) Add the socket binding <socket-binding name="messaging" port="5445"/>
If any queries please find the attachment named standalone-pool.xml
3) Once this configuaration done success download the hornetq from www.hornetq.com
4) For Starting the hornetq open terminal or cmd and goto hornetq -->bin (folder)
5) If you are using linux then type command ./run.sh .If it in windows ./run.bat
If everything goes fine in terminal or command you can see a message hornetq is started
6)Then start the jboss you can see a message hornetq resource adapter started
Create a queue or topic in hornetq-server and then deploy your application in jboss .
-
2. Re: Example on how to connect to a remote HornetQ topic from an MDB
cremersstijn Jun 2, 2014 5:41 AM (in response to ravi.teja)That works if all your mdb's need to connect to the same jms server, but not if 1 mdb should connect to server A and another mdb to server B.
But we have found the solution, we need to create another pooled-connection-factory and reference this on the mdb using @ResourceAdapter