-
1. Re: Remote JMS client cant connect to the HornetQ (which is embedded with jboss 7.1.1 as)
jbertram Oct 11, 2013 10:47 AM (in response to ajinkya.bambal)Where are you binding the server (i.e. where is the server listening for connections)?
-
2. Re: Remote JMS client cant connect to the HornetQ (which is embedded with jboss 7.1.1 as)
ajinkya.bambal Oct 15, 2013 5:51 AM (in response to jbertram)Server is at remote location , I am binding server with 0.0.0.0 , I am trying to connect using RemoteConnectionFactory
as remote://MyIp:4447 with server ( sorry plz elaborate ur question if i am not able to answer ur question ).
-
3. Re: Remote JMS client cant connect to the HornetQ (which is embedded with jboss 7.1.1 as)
jbertram Oct 11, 2013 2:39 PM (in response to ajinkya.bambal)The fact that you are binding to 0.0.0.0 is likely the problem. See HORNETQ-952 for more details. To resolve this either don't bind to 0.0.0.0 or move to a later release of AS7 (or Wildfly).
Connections for JNDI lookups happen via port 4447. If you look-up a JMS connection factory then the client will use the information configured on the server for that connection factory for any connections created from it. By default, those connections use port 5445.
-
4. Re: Remote JMS client cant connect to the HornetQ (which is embedded with jboss 7.1.1 as)
ajinkya.bambal Oct 13, 2013 12:39 PM (in response to jbertram)Hi Justin,
Thanks for your quick reply .
1 ) I have added following configuration in standalone-full.xml ,
<connector name="remote-jms">
<factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
<param key="host" value="servers own IP-address"/> aka 192.1.....
<param key="port" value="5445"/>
</connector>
and
<connector-ref connector-name="remote-jms"/> to the connectors of the RemoteConnectionFactory.
It worked fine , In my jboss Brontes . But I didnt understand clearly why it worked . Could you plz explain.
2)
Connections for JNDI lookups happen via port 4447. If you look-up a JMS connection factory then the client will use the information configured on the server for that connection factory for any connections created from it. By default, those connections use port 5445.
As you explained that using port no 4447 , client do JNDI lookup of administered objects(Destination & connectionFactory) in JNDI Server . After lookup client creates connection with server on port no 5445 in order to send/receive messges to/from server .
Please correct me if i am wrong...
-
5. Re: Remote JMS client cant connect to the HornetQ (which is embedded with jboss 7.1.1 as)
jbertram Oct 15, 2013 9:30 PM (in response to ajinkya.bambal)It worked fine , In my jboss Brontes . But I didnt understand clearly why it worked . Could you plz explain.
Read the "Description" on HORNETQ-952.
-
6. Re: Remote JMS client cant connect to the HornetQ (which is embedded with jboss 7.1.1 as)
ajinkya.bambal Oct 16, 2013 4:06 AM (in response to jbertram)Hi Justin,
Sorry for troubling you again . I have few other question....
1)Since Acceptors are used to accept connections where server can accept connections requested by clients & connectors are used to connect to the server ( in case of cluster where hornetq server itself acts like a client) . So my question is in HORNETQ-952 , you have mentioned about "netty connector" but in this case we have to configure "netty acceptor"
instead of netty connector .
2)Since I have added new connector "remote-jms" as I mentioned above , will it work fine without following your solution (i.e dont bind to 0.0.0.0 or move to a later release of AS7 (or Wildfly))
because for me it is very difficult to migrate from brontes to wildfly .
3) In in HORNETQ-952 , I have seen that changes has been applied on hornetq 2.2.19 or later . Currently my jboss brontes uses hornetq 2.2.13 .So can I migrate hornetQ from version 2.2.13 to 2.2.19 by keeping my jboss version constant (Brontes) . If yes then what changes do I need to make in my brontes?
4) If my server gets crashed that means server's session & connection objects also gets deleted (I am not using hornetq in clustered mode ) , so is it possible that after restarting the server Will the same clients be able to reconnect with the server with same session?
Sorry again If I am asking silly questions...
I really appreciate your help.... thanks....
-
7. Re: Remote JMS client cant connect to the HornetQ (which is embedded with jboss 7.1.1 as)
jbertram Oct 16, 2013 10:01 AM (in response to ajinkya.bambal)1 of 1 people found this helpfulSo my question is in HORNETQ-952 , you have mentioned about "netty connector" but in this case we have to configure "netty acceptor" instead of netty connector .
From what I understand you have already configured your the "netty" acceptor to use 0.0.0.0. Is that not correct?
Also, this isn't really a question or perhaps I misunderstood what you're asking.
3) In in HORNETQ-952 , I have seen that changes has been applied on hornetq 2.2.19 or later . Currently my jboss brontes uses hornetq 2.2.13 .So can I migrate hornetQ from version 2.2.13 to 2.2.19 by keeping my jboss version constant (Brontes) . If yes then what changes do I need to make in my brontes?
I'm not sure if HornetQ 2.2.19 is compatible with that version of JBoss AS7. In order to test it, you'd have to download the 2.2.19 tag of HornetQ and build it and then replace the existing HornetQ libraries in JBoss AS7 with the new ones.
4) If my server gets crashed that means server's session & connection objects also gets deleted (I am not using hornetq in clustered mode ) , so is it possible that after restarting the server Will the same clients be able to reconnect with the server with same session?
It's possible in a manner of speaking. Read the HornetQ documentation related to this - Client Reconnection and Session Reattachment.
-
8. Re: Remote JMS client cant connect to the HornetQ (which is embedded with jboss 7.1.1 as)
ajinkya.bambal Oct 18, 2013 12:43 AM (in response to jbertram)Hi Justin ,
Following are my configuration for messaging subsystem,
<subsystem xmlns="urn:jboss:domain:messaging:1.1">
<hornetq-server>
<persistence-enabled>true</persistence-enabled>
<journal-file-size>102400</journal-file-size>
<journal-min-files>2</journal-min-files>
<!-- <security-enabled>false</security-enabled> -->
<connectors>
<connector name="remote-jms">
<factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
<param key="host" value="192.168.35.45"/>
<param key="port" value="5445"/>
</connector>
<netty-connector name="netty" socket-binding="messaging"/>
<netty-connector name="netty-throughput" socket-binding="messaging-throughput">
<param key="batch-delay" value="50"/>
</netty-connector>
<in-vm-connector name="in-vm" server-id="0"/>
</connectors>
<acceptors>
<netty-acceptor name="netty" socket-binding="messaging">
<param key="batch-delay" value="50"/>
<param key="direct-deliver" value="false"/>
</netty-acceptor>
<netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">
<param key="batch-delay" value="50"/>
<param key="direct-deliver" value="false"/>
</netty-acceptor>
<in-vm-acceptor name="in-vm" server-id="0"/>
</acceptors>
<security-settings>
<security-setting match="#">
<permission type="send" roles="guest"/>
<permission type="consume" roles="guest"/>
<permission type="createDurableQueue" roles="guest"/>
<permission type="deleteDurableQueue" roles="guest"/>
<permission type="createNonDurableQueue" roles="guest"/>
<permission type="deleteNonDurableQueue" roles="guest"/>
</security-setting>
</security-settings>
<address-settings>
<address-setting match="#">
<dead-letter-address>jms.queue.DLQ</dead-letter-address>
<expiry-address>jms.queue.ExpiryQueue</expiry-address>
<redelivery-delay>0</redelivery-delay>
<max-size-bytes>10485760</max-size-bytes>
<address-full-policy>BLOCK</address-full-policy>
<message-counter-history-day-limit>10</message-counter-history-day-limit>
</address-setting>
</address-settings>
<jms-connection-factories>
<connection-factory name="InVmConnectionFactory">
<connectors>
<connector-ref connector-name="in-vm"/>
</connectors>
<entries>
<entry name="java:/ConnectionFactory"/>
</entries>
</connection-factory>
<connection-factory name="RemoteConnectionFactory">
<connectors>
<connector-ref connector-name="netty"/>
<connector-ref connector-name="remote-jms"/>
</connectors>
<entries>
<entry name="RemoteConnectionFactory"/>
<entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>
</entries>
<client-failure-check-period>30000</client-failure-check-period>
<connection-ttl>120000</connection-ttl>
<call-timeout>300000</call-timeout>
<confirmation-window-size>1048576</confirmation-window-size>
<block-on-acknowledge>true</block-on-acknowledge>
<block-on-non-durable-send>true</block-on-non-durable-send>
<block-on-durable-send>true</block-on-durable-send>
<retry-interval>1000</retry-interval>
<!-- <retry-interval-multiplier>1.5</retry-interval-multiplier>
<max-retry-interval>4000</max-retry-interval> -->
<reconnect-attempts>10</reconnect-attempts>
</connection-factory>
<pooled-connection-factory name="hornetq-ra">
<transaction mode="xa"/>
<connectors>
<connector-ref connector-name="in-vm"/>
</connectors>
<entries>
<entry name="java:/JmsXA"/>
</entries>
</pooled-connection-factory>
</jms-connection-factories>
<jms-destinations>
<jms-queue name="OrbQueue">
<entry name="java:jboss/exported/jms/queue/OrbQueue"/>
<entry name="queue/OrbQueue"/>
<durable>true</durable>
</jms-queue>
<jms-topic name="OrbTopic">
<entry name="topic/OrbTopic"/>
<entry name="java:jboss/exported/jms/topic/OrbTopic"/>
</jms-topic>
</jms-destinations>
</hornetq-server>
</subsystem>
Please notice on connector named "remote-jms" ,After adding this connector it worked fine. Now client can be able to do JNDI lookup & create & connect session
But now I am facing new Timeout Exception,I think I have configured parameters like connection-ttl , retry-interval , client-failure-check-period , confirmation-window-size , reconnect-attempt coreectly . So am I missing something? Following is the exception....
javax.jms.JMSException: Timed out waiting for response when sending packet 30
at org.hornetq.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:276)
at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:695)
at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSession(ClientSessionFactoryImpl.java:264)
at org.hornetq.jms.client.HornetQConnection.authorize(HornetQConnection.java:589)
at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:694)
at org.hornetq.jms.client.HornetQConnectionFactory.createTopicConnection(HornetQConnectionFactory.java:145)
at LoginConnection.createTopicConnection(BaseLoginConnection.java:413) ... 14 more
Caused by: HornetQException[errorCode=3 message=Timed out waiting for response when sending packet 30]
-
9. Re: Remote JMS client cant connect to the HornetQ (which is embedded with jboss 7.1.1 as)
jbertram Oct 18, 2013 10:38 AM (in response to ajinkya.bambal)1 of 1 people found this helpfulI would recommend you change the "netty" connector itself rather than add a completely new connector. Either that or remove the "netty" connector-ref from the RemoteConnectionFactory. Aside from that your configuration looks fine as far as I can tell.
What's the use-case here?
-
10. Re: Remote JMS client cant connect to the HornetQ (which is embedded with jboss 7.1.1 as)
ajinkya.bambal Oct 22, 2013 5:45 AM (in response to jbertram)Hi Justin,
The use case is ,
In my standalone application ,I have 5 JMS clients gets initialised as a part of resource initialisation process (i.e at the startup of application) & I am putting those resources in Resource Factory .
I am getting above exception (javax.jms.JMSException: Timed out waiting for response when sending packet 30) whenever first JMS client resource is getting initialised (JNDI lookup is successful but fail to create connection & sesson) .
But later rest of the 4 JMS client resources are getting initialised correctly without any exception.
I tried to change initialisation order of these JMS resources , what I found is above exception is coming when first JMS client resource is getting initalised.
I have already shared hornetq server config with you.
I appriciate your help.
Thanks.
-
11. Re: Remote JMS client cant connect to the HornetQ (which is embedded with jboss 7.1.1 as)
jbertram Oct 22, 2013 10:29 AM (in response to ajinkya.bambal)So did you implement the recommendations I made in my previous reply? If so, can you attach your current configuration?
Other than that might just do a simple proof-of-concept where the application and the server run on the same machine and the server is bound to 127.0.0.1. Make sure everything works as expected in that scenario and then try to run them on different machines.
-
12. Re: Remote JMS client cant connect to the HornetQ (which is embedded with jboss 7.1.1 as)
ajinkya.bambal Oct 23, 2013 6:09 AM (in response to jbertram)Hi Justin,
As I explained you test case in previous post ,
Hi Justin,
The use case is ,
In my standalone application ,I have 5 JMS clients gets initialised as a part of resource initialisation process (i.e at the startup of application)
& I am putting those resources in Resource Factory .I am getting above exception
(javax.jms.JMSException: Timed out waiting for response when sending packet 30)
whenever first JMS client resource is getting initialised (JNDI lookup is successful but fail to create connection & sesson) .
But later rest of the 4 JMS client resources are getting initialised correctly without any exception.
I tried to change initialisation order of these JMS resources , what I found is above exception is coming
when first JMS client resource is getting initalised.I have already shared hornetq server config with you.
I appriciate your help.
Thanks.
I have observed follwing things:
1) If I start jboss server & remote JMS client application , Whenever first JMS client resource is getting initialised (JNDI lookup is successful but fail to create connection & session).
I am getting following exception:
(javax.jms.JMSException: Timed out waiting for response when sending packet 30
at org.hornetq.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:276)
at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:695)
at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSession(ClientSessionFactoryImpl.java:264)
at org.hornetq.jms.client.HornetQConnection.authorize(HornetQConnection.java:589)
at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:694)
at org.hornetq.jms.client.HornetQConnectionFactory.createTopicConnection(HornetQConnectionFactory.java:145)
at LoginConnection.createTopicConnection(BaseLoginConnection.java:413) ... 14 more
Caused by: HornetQException[errorCode=3 message=Timed out waiting for response when sending packet 30]
But later rest of the 4 JMS client resources are getting initialised correctly without any exception.
I tried to change initialisation order of these JMS resources , what I found is above exception is coming when first JMS client resource is getting initalised.
2) If I keep jboss server up & again try to restart remote standalone client JMS application then all the resources gets initialized correctly.
3) If I try to connect sample JMS Client program with remote jboss then it is getting connected correctly .
-
13. Re: Remote JMS client cant connect to the HornetQ (which is embedded with jboss 7.1.1 as)
ajinkya.bambal Oct 23, 2013 6:07 AM (in response to ajinkya.bambal)I would recommend you change the "netty" connector itself rather than add a completely new connector. Either that or remove the "netty" connector-ref from the RemoteConnectionFactory. Aside from that your configuration looks fine as far as I can tell.
As per your suggestion, I have completely removed netty connector under RemoteConnectionFactory. I am using "remote-jms" connector.
Justin Bertram wrote:
So did you implement the recommendations I made in my previous reply? If so, can you attach your current configuration?
Other than that might just do a simple proof-of-concept where the application and the server run on the same machine and the server is bound to 127.0.0.1. Make sure everything works as expected in that scenario and then try to run them on different machines.
If I bind jboss with 127.0.0.1 & try to connect application which is running on the same machine then I am getting first exception as:
javax.jms.JMSException: Failed to create session factory
at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:605)
at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:119)
at com.alacriti.pem.jms.subscriber.EventSubscriber.connectAndCreateSession(Unknown Source)
at com.alacriti.pem.jms.subscriber.EventSubscriber.init(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
.
.
.
Caused by: HornetQException[errorCode=2 message=Cannot connect to server(s). Tried with all available servers.]
then I tried to run the standalone JMS application and the server (bound to 0.0.0.0) on the same machine , It is working fine under remote://localhost:4447 but It is throwing above exception while instatiating first JMS client Resource (as I explained in previous post) using remote://192.168.35.45:4447
Following are my configuration for messaging subsystem:
<subsystem xmlns="urn:jboss:domain:messaging:1.1">
<hornetq-server>
<persistence-enabled>true</persistence-enabled>
<journal-file-size>102400</journal-file-size>
<journal-min-files>2</journal-min-files>
<connectors>
<connector name="remote-jms">
<factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
<param key="host" value="192.168.35.45"/>
<param key="port" value="5445"/>
</connector>
<netty-connector name="netty" socket-binding="messaging"/>
<netty-connector name="netty-throughput" socket-binding="messaging-throughput">
<param key="batch-delay" value="50"/>
</netty-connector>
<in-vm-connector name="in-vm" server-id="0"/>
</connectors>
<acceptors>
<netty-acceptor name="netty" socket-binding="messaging">
<param key="batch-delay" value="50"/>
<param key="direct-deliver" value="false"/>
</netty-acceptor>
<netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">
<param key="batch-delay" value="50"/>
<param key="direct-deliver" value="false"/>
</netty-acceptor>
<in-vm-acceptor name="in-vm" server-id="0"/>
</acceptors>
<security-settings>
<security-setting match="#">
<permission type="send" roles="guest, pf-server-role"/>
<permission type="consume" roles="guest, pf-server-role"/>
<permission type="createDurableQueue" roles="guest, pf-server-role"/>
<permission type="deleteDurableQueue" roles="guest, pf-server-role"/>
<permission type="createNonDurableQueue" roles="guest, pf-server-role"/>
<permission type="deleteNonDurableQueue" roles="guest, pf-server-role"/>
</security-setting>
</security-settings>
<address-settings>
<address-setting match="#">
<dead-letter-address>jms.queue.DLQ</dead-letter-address>
<expiry-address>jms.queue.ExpiryQueue</expiry-address>
<redelivery-delay>0</redelivery-delay>
<max-size-bytes>10485760</max-size-bytes>
<address-full-policy>BLOCK</address-full-policy>
<message-counter-history-day-limit>10</message-counter-history-day-limit>
</address-setting>
</address-settings>
<jms-connection-factories>
<connection-factory name="InVmConnectionFactory">
<connectors>
<connector-ref connector-name="in-vm"/>
</connectors>
<entries>
<entry name="java:/ConnectionFactory"/>
</entries>
</connection-factory>
<connection-factory name="RemoteConnectionFactory">
<connectors>
<!-- <connector-ref connector-name="netty"/> -->
<connector-ref connector-name="remote-jms"/>
</connectors>
<entries>
<entry name="RemoteConnectionFactory"/>
<entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>
</entries>
<client-failure-check-period>10000</client-failure-check-period>
<connection-ttl>300000</connection-ttl>
<call-timeout>20000</call-timeout>
<!-- <initial-connect-attempts>3</initial-connect-attempts> -->
<confirmation-window-size>1048576</confirmation-window-size>
<retry-interval>2000</retry-interval>
<reconnect-attempts>10</reconnect-attempts>
</connection-factory>
<pooled-connection-factory name="hornetq-ra">
<transaction mode="xa"/>
<connectors>
<connector-ref connector-name="in-vm"/>
</connectors>
<entries>
<entry name="java:/JmsXA"/>
</entries>
</pooled-connection-factory>
</jms-connection-factories>
<jms-destinations>
<jms-queue name="RequestQueue">
<entry name="java:jboss/exported/jms/queue/RequestQueue"/>
<entry name="queue/RequestQueue"/>
<durable>true</durable>
</jms-queue>
<jms-queue name="ResponseQueue">
<entry name="java:jboss/exported/jms/queue/ResponseQueue"/>
<entry name="queue/ResponseQueue"/>
<durable>true</durable>
</jms-queue>
<jms-topic name="RequestTopic">
<entry name="topic/RequestTopic"/>
<entry name="java:jboss/exported/jms/topic/RequestTopic"/>
</jms-topic>
</jms-destinations>
</hornetq-server>
</subsystem>
-
14. Re: Remote JMS client cant connect to the HornetQ (which is embedded with jboss 7.1.1 as)
ajinkya.bambal Nov 13, 2013 8:03 AM (in response to ajinkya.bambal)Hi Justin ,
I have resolved above issue by disabling security for messaging (<enable-security>false</enable-security> ) and everything worked fine for me .
But still I am not very clear behind the reason . Is this a new bug with jboss messaging security ?