[jboss-user] [JBoss Messaging] - Re: New JBoss Messaging clustering

2009-01-03 Thread timfox
Probably you haven't deployed your queue on both nodes.

Regarding CTRL-C - there is a FAQ on this and many old discussions in JIRA and 
on the forums.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4199319#4199319

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4199319
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Messaging] - Re: New JBoss Messaging clustering

2008-12-30 Thread jbabad
Hi, 

Thanks for the replies.
I realised that I forgot to mention that in the scenario when both sender and 
receiver programs are connecting to node1's JNDI and I then shut down the node, 
then the sender program crashes with the exception
Exception: Failed to route Reference[20162686882938884]:RELIABLE to 
testDistributedQueue
This is the same exception seen in the server log that I included initially.

I was hoping that the sender would transparently start sending the messages via 
the other node in the cluster. 
When the sender and receiver connect to the different nodes' JNDI, it does seem 
to cope with shutting down the node and the sender continues to send messages.

Sender code is as follows - basically a setup followed by a loop attempting to 
send 10 messages (some of the code not included):



  | public void setUpJms(String port) throws Exception {
  | 
  | String destinationName = System.getProperty("example.queue.name");
  | 
  | 
  | 
  | ConnectionFactory cf = null;
  | 
  | //try {
  | // Create a connection to the clustered messaging instance
  | 
  | Hashtable env = new Hashtable();
  | 
env.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
  | env.put("java.naming.provider.url","jnp://localhost:" + port);
  | 
env.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
  | ic = new InitialContext(env);
  | 
  | cf = (ConnectionFactory) 
ic.lookup("/ClusteredConnectionFactory");
  | 
  | Queue distributedQueue = (Queue) ic.lookup(destinationName);
  | log("Distributed queue " + destinationName + " exists");
  | 
  | // When connecting to a messaging cluster, the 
ConnectionFactory has the capability of
  | // transparently creating physical connections to different 
cluster nodes, in a round
  | // robin fashion ...
  | 
  | connection = cf.createConnection();
  | 
  | connection.start();
  | 
  | // Send 2 messages to the queue
  | 
  | session = connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE);
  | 
  | messageProducer = session.createProducer(distributedQueue);
  | 
  | displayProviderInfo(connection.getMetaData());
  | 
  | return;
  | 

  | public void sendMessage( String message) throws JMSException
  | {
  | 
  | TextMessage message1 = session.createTextMessage(message);
  | 
  |  messageProducer.send(message1);
  | 
  | }
  | 

  |public static void main(String[] args)
  |{
  |System.setProperty("example.queue.name", 
"/queue/testDistributedQueue");
  | 
  |
  |try {
  |JmsSender sender  = new JmsSender();
  |sender.setUpJms(args[0]);
  | 
  |for (int i=0; i<10; i++)
  |{
  |log("Sending message: " + i);
  |sender.sendMessage("Hello" + i);
  |Thread.sleep(5000);
  |}
  |sender.close();
  |} catch (Exception e) {
  |log("Exception: "  + e.getMessage());
  |}
  |}
  | 

I then realised that I wasn't trapping the exception in the sendMessage method 
which meant that it filtered up to main and exited the program.

Obvious really, but still strange as this wasn't an issue when the sender and 
receiver programs were connecting to different nodes?

Trapping the exception in sendMessage meant that I could attempt to re-send the 
message.  Going down this route I saw a couple of things.

Doing a CTRL-C shutdown I still saw messages either going missing or being 
duplicated. I  still sometimes got the "Failed to Route" error, but at least I 
could continue to attempt to send messages.
Killing the JBoss instance (kill -9) seemed to fail-over OK with no loss of data

So, 

 are these observations consistent with what would be expected?
(Note in both these scenarios both  the sender and receiver initially connect 
to the same node)
Why the difference when both programs are initially connected to a single node 
- when I need to trap the send exception - as opposed to when they are 
connected to different nodes and that exception doesn't appear to happen?


Cheers,
Joseph.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4198912#4198912

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4198912
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Messaging] - Re: New JBoss Messaging clustering

2008-12-29 Thread clebert.suco...@jboss.com
You are killing one of the nodes. The communication between them was 
interrupted. You're still supposed to see failures on logs from broken 
connections.


What should happen is the servers recovering from the failures. That's what 
failover is supposed to do... recover from failures, what means messages being 
received on client as the server didn't fail.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4198788#4198788

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4198788
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Messaging] - Re: New JBoss Messaging clustering

2008-12-28 Thread gaohoward
Hi, 
try to let node1 use ports-01 and nod2 use ports-02. If still fail, can you 
enable the DEBUG or Trace log level and see if there is more infomation in the 
log? Normally, if you correctly setup the cluster, failover will be performed 
when you shutdown one node. 


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4198463#4198463

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4198463
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Messaging] - Re: New JBoss Messaging clustering

2008-12-28 Thread jbabad
Apologies for the subject line should have read: New to JBoss Messaging 
Clustering... :)

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4198456#4198456

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4198456
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user