-
1. Re: JMS connection factory errors when connecting to remote HornetQ server
jbertram Feb 6, 2015 11:20 AM (in response to raylite3)What kind of connection are you trying to create/use? Are you making a normal JMS connection or are you using JCA?
On instance1 do you have a Netty acceptor listening on port 8080?
-
2. Re: JMS connection factory errors when connecting to remote HornetQ server
raylite3 Feb 6, 2015 1:45 PM (in response to jbertram)I am using a normal JMS connection. I have a http-acceptor defined in instance1 as below.
<connectors>
<http-connector name="http-connector" socket-binding="http">
<param key="http-upgrade-endpoint" value="http-acceptor"/>
</http-connector>
<in-vm-connector name="in-vm" server-id="0"/>
</connectors>
<acceptors>
<http-acceptor http-listener="default" name="http-acceptor"/>
<in-vm-acceptor name="in-vm" server-id="0"/>
</acceptors>
Do I need to setup a netty acceptor (listening on a separate port 5445 for example) in order to connect up instance2 to instance1? I thought I could setup the http-acceptor only on instance1 so I don't need another port.
-
3. Re: JMS connection factory errors when connecting to remote HornetQ server
raylite3 Feb 6, 2015 2:22 PM (in response to raylite3)I am using a normal JMS connection. I have a http-acceptor defined in instance1 as below.
<connectors>
<http-connector name="http-connector" socket-binding="http">
<param key="http-upgrade-endpoint" value="http-acceptor"/>
</http-connector>
<in-vm-connector name="in-vm" server-id="0"/>
</connectors>
<acceptors>
<http-acceptor http-listener="default" name="http-acceptor"/>
<in-vm-acceptor name="in-vm" server-id="0"/>
</acceptors>
Do I need to setup a netty acceptor (listening on a separate port 5445 for example) in order to connect up instance1 to instance2? I want to setup the http-acceptor only on instance1 so I don't need another port.
Or can I use a different factory class instead of the NettyConnectorFactory in instance2 ?
-
4. Re: JMS connection factory errors when connecting to remote HornetQ server
jbertram Feb 6, 2015 10:59 PM (in response to raylite3)If you're using a normal JMS connection why do you need to administratively define a connector? Typically in such a use-case you'd just look up a connection factory on instance1 using JNDI from your client on instance2. Is that not what you're doing? Please clarify.
In any event, a Netty connector can't connect to an HTTP acceptor. The connector and acceptor types must match.
-
5. Re: JMS connection factory errors when connecting to remote HornetQ server
raylite3 Feb 6, 2015 5:58 PM (in response to jbertram)Thanks for the response. What I have been doing in AS7.x/EAP is define a connector that points from instance2 to instance1 and my code uses a local JNDI lookup. I thought I also needed to define my connection factories in this fashion to use MDBs in instance2 that receive messages from instance1.
<connection-factory name="RemoteConnectionFactory">
<connectors>
<connector-ref connector-name="remote-jms-connector"/>
</connectors>
<entries>
<entry name="java:jboss/exported/jms/connectionFactory"/>
</entries>
</connection-factory>
<pooled-connection-factory name="mdb-hornetq-ra">
<transaction mode="xa"/>
<connectors>
<connector-ref connector-name="remote-jms-connector"/>
</connectors>
<entries>
<entry name="java:/jms/PooledConnectionFactory"/>
<entry name="java:jboss/DefaultJMSConnectionFactory"/>
</entries>
</pooled-connection-factory>
instance1 is a dedicated JBoss/Wildfly instance for messaging. All other nodes connect to it to publish/receive and I have been configuring a Netty connector to do this. In Wildfly, is this not possible? And is remote JNDI lookup the recommended alternative?
Thanks!
-
6. Re: JMS connection factory errors when connecting to remote HornetQ server
jbertram Feb 6, 2015 11:55 PM (in response to raylite3)It's certainly possible to define a local connector pointing to a remote server, configure a local connection factory with that connector, and then look up that connection factory from your local clients. As I stated in my previous comment you just need to make sure your connectors and acceptors are matched up (e.g. use an http-connector to connect to an http-acceptor, use a netty-connector to connect to a netty-acceptor, etc.). What you have currently configured just isn't compatible.
That said, since you are running in an application server I would encourage you to avail yourself of its features and send your messages using a pooled-connection-factory (i.e. a JCA-based connection factory). Performance will be much better and transaction management will be simpler as well.
As far as MDBs go, you don't have to configure a remote connector via XML. You can do all the configuration you need via activation configuration properties on the MDB itself if you like.