This content has been marked as final.
Show 4 replies
-
1. Re: Missing messages after the failover of Jboss Node
gaohoward Aug 21, 2009 9:47 AM (in response to mayankmit2002)Can you post your receiving code here?
Thanks. -
2. Re: Missing messages after the failover of Jboss Node
mayankmit2002 Aug 21, 2009 9:50 AM (in response to mayankmit2002)plz. find below my receiver code
private void createJMSClient () { final Properties props = new Properties(); props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces"); props.put(Context.PROVIDER_URL, "NOICLT13274:1100,NOICLT22560:1100,NOICLT13407:1100"); props.put("jnp.timeout", "1000"); props.put("jnp.sotimeout", "1000"); props.put("jnp.disablediscovery", "true"); props.put("jnp.partitionName", "NOICLT22560_PARTITION"); try { final Context context = new InitialContext(props); ConnectionFactory mTopicConnectionFactory = (ConnectionFactory) context.lookup("ClusteredConnectionFactory"); System.out.println(mTopicConnectionFactory); Topic mTopic = (Topic) context.lookup("topic/CMSPublic"); Connection mTopicConnection = mTopicConnectionFactory.createConnection(); Session mTopicSession = mTopicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE); // Create subscriber MessageConsumer mSubscriber = mTopicSession.createConsumer(mTopic); mSubscriber.setMessageListener(this); mTopicConnection.setExceptionListener(this); mTopicConnection.start(); isConnected = true; } catch (final CommunicationException anException) { // anException.printStackTrace(); System.err.println("Server is not avaliable!!! \n Trying to reconnect the server!! " + anException.getMessage()); } catch (final NamingException anException) { // anException.printStackTrace(); System.err.println("Server is not avaliable!!! \n Trying to reconnect the server!! " + anException.getMessage()); } catch (final JMSException anException) { // anException.printStackTrace(); System.err.println("Server is not avaliable!!! \n Trying to reconnect the server!! " + anException.getMessage()); } catch (Exception finalException) { // finalException.printStackTrace(); System.err.println("Exception while starting JMS event listener. You may not be able to receive event, please restart your application"); } }
-
3. Re: Missing messages after the failover of Jboss Node
gaohoward Aug 21, 2009 9:59 AM (in response to mayankmit2002)I think you should use durable subscriber to make sure the message won't get lost. Can you try?
Thanks
Howard -
4. Re: Missing messages after the failover of Jboss Node
mayankmit2002 Aug 21, 2009 10:08 AM (in response to mayankmit2002)Durable subscription didn't suites our requirement as, durable subscription supports only one active subscriber at a rime.
But, in our real scenario, we are targeting more than 1000 clients.