-
1. Re: Remoting Queues and Local Queues in JBOSS 7.
jbertram Nov 6, 2013 3:02 PM (in response to murthy516)I've these entries in standalone-full.xml...Should I need to specify the JNDI Name to configure the remoting queue/local queue..
I'm not clear on what you're asking here. Can you explain more about what you're trying to do?
And,Can I use netty Connector to publish the messages to local queue.I'm able to push messages to Remote Queue using Netty Connector.I'm using InVm Connector to publish the messages to local queues.Can I able to do that with NettyConnector using RemoteConnectionFactory for local queues instead of INVM??
Yes. Although you won't get the performance benefit of the in-vm connector.
-
2. Re: Remoting Queues and Local Queues in JBOSS 7.
murthy516 Nov 7, 2013 2:55 AM (in response to jbertram)Thanks Justin for your valuable response.
My clarification is how to configure the queue Name in standaone-full.xml..Is it with JNDI Name or without JNDI Name.
1--------- <jms-queue name="testQueue">
<entry name="queue/test"/>
<entry name="java:jboss/exported/jms/queue/test"/>
</jms-queue>
2---- <jms-queue name="myQueue">
<entry name="queue/myQueue"/>
</jms-queue>
What is the difference between those two configurations with and without JNDI Names.
2.And,If I Use Netty Connector to publish the messages to Local Queues with the code specified below
env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.remote.client.InitialContextFactory");
env.put(Context.PROVIDER_URL, "remote://localhost:5445");
env.put(Context.URL_PKG_PREFIXES, "org.jnp.interfaces:org.jboss.naming");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, userName);
env.put(Context.SECURITY_CREDENTIALS, password);
ConnectionFactory connectionFactory=null;
InitialContext initialContext = new InitialContext(env);
connectionFactory = (ConnectionFactory) initialContext.lookup("/jms/RemoteConnectionFactory");
Queue queue = (Queue) initialContext.lookup("queue/myQueue");//myQueue which is Local Queue..
connection = connectionFactory.createConnection(userName,password);
Session session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
MessageProducer sender = session.createProducer(queue);
TextMessage message = session.createTextMessage(textMessage);
sender.send(message);
connection.start();
connection.close();
This code is not publishing the messages to the myQueue..It is giving NamingException..Please suggest me in these naming configurations and the netty-connector.
Thanks
Kris
-
3. Re: Remoting Queues and Local Queues in JBOSS 7.
jbertram Nov 7, 2013 11:05 AM (in response to murthy516)What is the difference between those two configurations with and without JNDI Names.
Both of the two configuration have JNDI names. An <entry> represents a JNDI binding. The "testQueue" has 2 JNDI bindings, one of which will be available to remote clients since it is in the "java:jboss/exported" namespace. The "myQueue" has 1 JNDI binding which is not in the "java:jboss/exported" namespace which means that queue will not be available to remote clients.
This code is not publishing the messages to the myQueue..It is giving NamingException..Please suggest me in these naming configurations and the netty-connector.
The problem here has nothing to do with the netty-connector used by "RemoteConnectionFactory". The problem is that you are doing a remote JNDI lookup on a resource (i.e. "queue/myQueue") which isn't available for remote lookups.
BTW, this is all explained in the documentation.
-
4. Re: Remoting Queues and Local Queues in JBOSS 7.
murthy516 Nov 8, 2013 5:25 AM (in response to jbertram)Thanks Justin for the response.Can you suggest me how can I publish to "myQueue"(which was configured above) using NETTY Connector instead of In-VM...Using In-VM,I Achieved using the below code.
String CNN_FACTORY="/JmsXA";
String QUEUE_NAME="queue/myQueue";
InitialContext ctx = new InitialContext();
qconFactory = (QueueConnectionFactory) ctx.lookup(CNN_FACTORY);
qcon = qconFactory.createQueueConnection();
qsession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
queue = (Queue) ctx.lookup(QUEUE_NAME);
qsender = qsession.createSender(queue);
msg = qsession.createObjectMessage();
qcon.start();
msg.setObject((Serializable) message) ;// Messages
qsender.send(msg);
The same thing how can I achieve through NETTY Connection Factory.Please suggest me..And Once again Thank you for clearing me regarding the Configurations of Queues.
Thanks
Kris
-
5. Re: Remoting Queues and Local Queues in JBOSS 7.
jbertram Nov 8, 2013 10:54 AM (in response to murthy516)Why do you want to publish to a local queue using a Netty connector?
-
6. Re: Remoting Queues and Local Queues in JBOSS 7.
murthy516 Nov 10, 2013 10:03 AM (in response to jbertram)Hi,
I've a connection time-out problems with In-Vm Connector. Red-Hat People suggested - use netty connector instead of in-vm which is more stable than in-vm connector.
Can you please suggest me.
Thanks
Kris
-
7. Re: Remoting Queues and Local Queues in JBOSS 7.
jbertram Nov 13, 2013 10:16 AM (in response to murthy516)The connection timeout parameters (i.e. connection-ttl and client-failure-check-period) can be tuned for an in-vm connection just like it can for a Netty connection so you should be able to fix the timeout problem.
However, if you must use a Netty connector then just lookup "java:jboss/exported/jms/RemoteConnectionFactory" from your local client. Or you can change the default <pooled-connection-factory> to use the "netty" connector instead of "in-vm".
In any event, I'm curious about your specific situation and who exactly told you to switch to the netty connector. What kind of problems are you having with in-vm?
-
8. Re: Remoting Queues and Local Queues in JBOSS 7.
murthy516 Nov 14, 2013 11:54 AM (in response to jbertram)Thank you Justin for the response.
We've raised a ticket in RedHat saying I'm having connection-failures detected warning messages in the log whenever server goes to idle state.They suggested to set connection-ttl to -1 or to use Netty Instead of InVM which is more stable.
Setting Connection-ttl to -1 also not resolving my problem..So,I'm looking through Netty Connector.Actually I'm also getting Connection-failover messages and also
Unable to get managed connection for java:/JmsXA : javax.jms.JMSException: Could not create a session: IJ000453: Unable to get managed connection for java:/JmsXA
at org.hornetq.ra.HornetQRASessionFactoryImpl.allocateConnection(HornetQRASessionFactoryImpl.java:881)
at org.hornetq.ra.HornetQRASessionFactoryImpl.createQueueSession(HornetQRASessionFactoryImpl.java:237)
So,When I restart the server,Every thing is working fine,Why my Hornetq connection is not getting established?And why these connection-failovers.I've nearly 25 JMS Queues with running 25 MDB's.Each Having 15 Sessions.And My Address-Policy in standalone-full.xml is PAGE with mdb-strict-max-pool as 180.
Please suggest me Justin,
-
9. Re: Remoting Queues and Local Queues in JBOSS 7.
jbertram Nov 14, 2013 2:48 PM (in response to murthy516)Can you provide me with steps to reproduce the issue you're seeing?
-
10. Re: Remoting Queues and Local Queues in JBOSS 7.
murthy516 Nov 15, 2013 9:07 AM (in response to jbertram)Hi Justin,
Thank you for the consideration of my Issue.Let me explain briefly about the Issues of HornetQ.The Connection-TTL Issue is occuring some times,But when I restart the server-Everything is working fine.I tried to re-produce the Issue with the following steps.
ERROR-1
10:16:50,657 WARN [org.hornetq.core.protocol.core.impl.RemotingConnectionImpl] (hornetq-failure-check-thread) Connection failure has been detected: Did not receive data from invm:0. It is likely the client has exited or crashed without closing its connection, or the network between the server and client has failed. You also might have configured connection-ttl and client-failure-check-period incorrectly. Please check user manual for more information. The connection will now be closed. [code=3]
1. Added <connection-ttl> with a value of 10000 for the connection factory which is being used by the client(java:/JmsXA).
2. Executed the client code to establish a connection to the queue and push a message.
3. Consumer on the queue was successfully able to pick up the message.
4. Next we executed the same client code to push a message, the message was successfully pushed to the queue, but the consumer was not picking the message.
5. Once we restart the server, the consumer was able to pick the message which was not picked up in the earlier session.
I'm closing all the connections on client side.But still why the HornetQ is getting crashed.If I set Connection-ttl to -1,After some hours,same problem is getting generated and same warning message is getting occurred.And No MDB is consuming the message.
ERROR-2:
(Occurring frequently)
This error also I'm getting when the server is NOT IDLE...It means the messages are publishing to the queue.But suddenly,a SEVERE Log I'm seeing saying that
Could not create a session: IJ000453: Unable to get managed connection for java:/JmsXA : javax.jms.JMSException: Could not create a session: IJ000453: Unable to get managed connection for java:/JmsXA
at org.hornetq.ra.HornetQRASessionFactoryImpl.allocateConnection(HornetQRASessionFactoryImpl.java:881)
at org.hornetq.ra.HornetQRASessionFactoryImpl.createQueueSession(HornetQRASessionFactoryImpl.java:237)
I've 25 Queues,Each have MDB with 15 sessions each.
So,I'm not able to push any message to the Queue.The Only way is to restarting the Server.
The ERROR is in the following Publisher
And the Publisher Code is
public class OrderPublisher
{
public static void publishMessage(String message)
{
QueueConnectionFactory qconFactory;
QueueConnection qcon = null;
QueueSession qsession = null;
QueueSender qsender = null;
Queue queue;
TextMessage msg = null;
try
{
//*************** Connection Factory JNDI name *************************
String CNN_FACTORY="/JmsXA";
//*************** Connection Factory JNDI name *************************
String QUEUE_NAME="queue/TestQ";
InitialContext ctx = new InitialContext();
qconFactory = (QueueConnectionFactory) ctx.lookup(CNN_FACTORY);
qcon = qconFactory.createQueueConnection();
qsession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
queue = (Queue) ctx.lookup(QUEUE_NAME);
qsender = qsession.createSender(queue);
msg = qsession.createTextMessage();
qcon.start();
msg.setText(message); // Messages
qsender.send(msg); // Messages sent
}
catch(Exception exception)
{
}
finally
{
try
{
if(qsession!=null)
qsession.close();
if(qsender!=null)
qsender.close();
if(qcon!=null)
{
qcon.close();
}
}
catch(Exception e)
{
}
}
}
}
IT IS GIVING ERROR-2(Unable to get managed Connections) in LINE----36---
qsession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); PLEASE HELP ME OUT
My Bean Instance Pool Size is
<bean-instance-pools>
<strict-max-pool name="slsb-strict-max-pool" max-pool-size="3000" instance-acquisition-timeout="1" instance-acquisition-timeout-unit="MILLISECONDS"/>
<strict-max-pool name="mdb-strict-max-pool" max-pool-size="180" instance-acquisition-timeout="1" instance-acquisition-timeout-unit="MILLISECONDS"/>
</bean-instance-pools>
Please HELP ME OUT...
Thank you Very much.
-
11. Re: Remoting Queues and Local Queues in JBOSS 7.
jbertram Nov 15, 2013 11:35 AM (in response to murthy516)Do you have a support subscription?
-
12. Re: Remoting Queues and Local Queues in JBOSS 7.
murthy516 Nov 15, 2013 1:04 PM (in response to jbertram)Yes,We have it....As the valuable forums can help me more to resolve these,I'm logging in these.
-
13. Re: Remoting Queues and Local Queues in JBOSS 7.
jbertram Nov 15, 2013 3:43 PM (in response to murthy516)This is a community forum with no SLA. If you have a support subscription I strongly recommend you use it.
-
14. Re: Remoting Queues and Local Queues in JBOSS 7.
murthy516 Nov 15, 2013 10:10 PM (in response to jbertram)Thank you Justin.I will make it in Subscription Channel.Mean-while Can you please give me the what the reason behind the Issue of that ERROR-2(Unable to get JMX Managed Connections).Please suggest me.
Regards
Krishna