-
1. Can't connect to remote hornetQ destinations from mdb
clebert.suconic Feb 3, 2011 4:27 PM (in response to totoranky)There's an example showing how to do that
-
2. Can't connect to remote hornetQ destinations from mdb
totoranky Feb 4, 2011 11:58 AM (in response to clebert.suconic)In my standalone hornetQ, in the hornetq-configuration.xml I forgot to put in connector and acceptor my IP machine instead of localhost
<connector name="netty">
<factory-class>org.hornetq.integration.transports.netty.NettyConnectorFactory</factory-class>
<param key="host" value="ip_here"/>
<param key="port" value="${hornetq.remoting.netty.port:5445}"/>
</connector>
Now my JBoss starts, hornetQ also but my mdb don't consume messages, I posted with a standalone java class and my mdb don't move. I am wondering if they are listening to my destinations
-
3. Can't connect to remote hornetQ destinations from mdb
clebert.suconic Feb 4, 2011 12:50 PM (in response to totoranky)Did you look at the example I told you? you have to change the connector's properties.
-
4. Can't connect to remote hornetQ destinations from mdb
257980 Feb 6, 2011 3:17 AM (in response to totoranky)Resource adapter by default is configured to make use of INVM connection. INVm is used only when both client & server are running in same JVM.
In order to connect to a remote HornetQ server use netty connection.
Follow the below steps.
unzip the hornetq-ra.rar
under META-INF folder you will find ra.xml with the below configuration
Just replace INVM configuration with netty
<config-property>
<description>The transport type</description>
<config-property-name>ConnectorClassName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</config-property-value>
</config-property>
<config-property>
<description>The transport configuration. These values must be in the form of key=val;key=val;</description>
<config-property-name>ConnectionParameters</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>server-id=0</config-property-value>
</config-property>
replace the above configuration with this
<config-property>
<description>The transport type</description>
<config-property-name>ConnectorClassName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>org.hornetq.integration.transports.netty.NettyConnectorFactory</config-property-value>
</config-property>
<config-property>
<description>The transport configuration. These values must be in the form of key=val;key=val;</description>
<config-property-name>ConnectionParameters</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>host=172.18.10.7;port=5445</config-property-value>
</config-property>
Where host is the hostname or ipaddress of the remote machine where your hornetQ is running.
port is the Netty Acceptor port number.
Once after making the change recreate the hornetq-ra.rar archive file.
Netty port number can be identified by looking in to hornetq-configuration.xml
It looks something like this.
<acceptor name="netty">
<factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
<param key="host" value="${jboss.bind.address:localhost}"/>
<param key="port" value="${hornetq.remoting.netty.port:5445}"/>
</acceptor>
Please let me know if you still face any issues after trying this configuration change.
-
5. Can't connect to remote hornetQ destinations from mdb
clebert.suconic Feb 6, 2011 7:19 PM (in response to 257980)That's the thirs time I ask... and you answer me with random configuration.
Did you actually look at the example?
I don't want to go over something you can easily find on the documentation. Let me know if you have any specific questions beyond the documentation.
-
6. Can't connect to remote hornetQ destinations from mdb
clebert.suconic Feb 6, 2011 7:19 PM (in response to clebert.suconic)examples/javaee/jca-remote
-
7. Can't connect to remote hornetQ destinations from mdb
totoranky Feb 7, 2011 5:29 AM (in response to clebert.suconic)First of all, thanks for your help everybody.
Clebert Suconic a écrit:
That's the thirs time I ask... and you answer me with random configuration.
The third time it was not me but another forum member who replies. And yes I have seen examples BUT never this one becauseI didn't know netty was a JCA connector. Actually, when I look jca-config example (and not jca-remote for my 2.0.0 hornetq server),
they explain how to configure resource adapter global properties.
It's exactly Ravisankar Challa proposition. I did it and my configuration works now !!!!!
So thank you Ravisankar Challa to lead me on right way, it's exactly the information I needed
-
8. Can't connect to remote hornetQ destinations from mdb
clebert.suconic Feb 7, 2011 8:59 AM (in response to totoranky)"The third time it was not me but another forum member who replies"
oops... sorry about that guys. I looked quickly at the forums in a sunday night and answered quicly. Thanks Ravisankar for helping on the answer.... My apologies guys.
"I didn't know netty was a JCA connector."
the JCA is using the same remoting mechanism used by the client.
-
9. Can't connect to remote hornetQ destinations from mdb
totoranky Feb 9, 2011 9:21 AM (in response to clebert.suconic)Is it possible to have the file ra.xml outside from hornetq-ra.xml in deploy directory as -ds file ?
I ask this information because if you move your hornetq server, you must unzip your rar file to edit ra.xml file
to put your new ip, it's not useful.
Maybe hornetq-ra.xml is totally "independent" and all its configuration must be inside the rar file.
Why do we need to put these same information (host and netty port) in our hornetq-ds.xml file where we defined
our ProviderName :
<mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="hornetq:service=JMSProviderLoader,name=JMSProvider">
<attribute name="ProviderName">DefaultJMSProvider</attribute>
<attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
<!-- The combined connection factory -->
<attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
<!-- The queue connection factory -->
<attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
<!-- The topic factory -->
<attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
<attribute name="Properties">
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=jnp://10.1.100.1:1499
</attribute>
</mbean>
<tx-connection-factory>
<jndi-name>JmsXA</jndi-name>
<rar-name>hornetq-ra.rar</rar-name>
<xa-transaction/>
<connection-definition>org.hornetq.ra.HornetQRAConnectionFactory</connection-definition>
<config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Queue</config-property>
<config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
<config-property name="ConnectorClassName" type="java.lang.String">org.hornetq.integration.transports.netty.NettyConnectorFactory</config-property>
<max-pool-size>20</max-pool-size>
<!-- Netty connector acces on remote hornetQ server (defined in hornetQ's hornetq-configuration.xml file) -->
<config-property name="ConnectionParameters" type="java.lang.String">host=10.1.100.1;port=5445</config-property>
</tx-connection-factory>
Lines java.naming.provider.url=jnp://10.1.100.1:1499 and
<config-property name="ConnectionParameters" type="java.lang.String">host=10.1.100.1;port=5445</config-property>
seem to be duplicate information with the ra.xml file configuration.
Personally I tried to comment this data in my hornetq-ds.xml file and it sounds to work but I am not sure I am right.
Thanks for your help