3 Replies Latest reply on Jul 18, 2012 7:04 AM by Andy Taylor

    Exception when doing overload test

    raymanf Newbie

      Hi,

       

      I am on Spring3.1 HornetQ 2.2.14 final

       

      I am trying to do overload test with hornetq and i am gettiong severe exception.

       

      scenario: dispach lots of messages via jms-template.

       

      in a normal rate it works fine. but when I am overloading I am getthign this:

       

      thats my

       

      java class:

       

      @Autowired
                private JmsTemplate marketMakerTopicTemplate;
      
      
                public void dispatchToTopic(final Object msg) throws Exception
                {
                          try
                          {
                                    marketMakerTopicTemplate.send(new MessageCreator()
                                    {
                                              public Message createMessage(Session session) throws JMSException
                                              {
                                                        log.trace("MarketMakerDispatcher, sending message...");
                                                        Serializable serializableMsg = (Serializable) msg;
                                                        return session.createObjectMessage(serializableMsg);
                                              }
                                    });
                          }
      
      
                          catch (Exception e)
                          {
                                    throw new Exception("Couldnt dispatch Msg to Sessions Topic:" + e.getMessage());
                          }
      

       

       

       

      xml configurations:

       

      <bean name="namingServerImpl" class="org.jnp.server.NamingBeanImpl"
                          init-method="start" destroy-method="stop" />
      
      
                <bean name="namingServer" class="org.jnp.server.Main" init-method="start"
                          destroy-method="stop">
                          <property name="namingInfo" ref="namingServerImpl" />
                          <property name="port" value="1099" />
                          <property name="bindAddress" value="localhost" />
                          <property name="rmiPort" value="3000" />
                          <property name="rmiBindAddress" value="localhost" />
                </bean>
      
      
      
      
                <bean name="fileConfiguration" class="org.hornetq.core.config.impl.FileConfiguration"
                          init-method="start" destroy-method="stop" />
      
      
                <bean name="hornetQSecurityManagerImpl"
                          class="org.hornetq.spi.core.security.HornetQSecurityManagerImpl" />
      
      
      <bean name="hornetQServerImpl" class="org.hornetq.core.server.impl.HornetQServerImpl">
                          <constructor-arg ref="fileConfiguration" />
                          <constructor-arg ref="mbeanServer" />
                          <constructor-arg ref="hornetQSecurityManagerImpl" />
                </bean>
      
      
      <bean name="jmsServerManagerImpl" class="org.hornetq.jms.server.impl.JMSServerManagerImpl"
                          init-method="start" destroy-method="stop" depends-on="namingServer">
                          <constructor-arg ref="hornetQServerImpl" />
                </bean>
      
      
                <bean name="connectionFactory" class="org.hornetq.jms.client.HornetQJMSConnectionFactory">
                          <constructor-arg name="ha" value="false" />
                          <constructor-arg>
                                    <bean class="org.hornetq.api.core.TransportConfiguration">
                                              <constructor-arg
                                                        value="org.hornetq.core.remoting.impl.netty.NettyConnectorFactory" />
                                              <constructor-arg>
                                                        <map key-type="java.lang.String" value-type="java.lang.Object">
                                                                  <entry key="port" value="5445"></entry>
                                                        </map>
                                              </constructor-arg>
                                    </bean>
                          </constructor-arg>
                </bean>
      
      
                <bean id="marketMakerTopicTemplate" class="org.springframework.jms.core.JmsTemplate">
                          <property name="connectionFactory" ref="connectionFactory" />
                          <property name="defaultDestination" ref="marketMakerTopic" />
                          <property name="pubSubDomain" value="true" />
                          <property name="receiveTimeout" value="1000" />
                </bean>
      
      
      
      

       

       

      This is the error I get:

       

      2012-07-18 12:37:11,795 com..fixgw.mdb.TgwMDB [ERROR] Error:Couldnt dispatch Msg to Sessions Topic:Uncategorized exception occured during JMS processing; nested exception is javax.jms.JMSException: Failed to create session factory; nested exception is HornetQException[errorCode=2 message=Cannot connect to server(s). Tried with all available servers.]
      java.lang.Exception: Couldnt dispatch Msg to Sessions Topic:Uncategorized exception occured during JMS processing; nested exception is javax.jms.JMSException: Failed to create session factory; nested exception is HornetQException[errorCode=2 message=Cannot connect to server(s). Tried with all available servers.]
                at com..fixgw.beans.MarketMakerDispatcher.dispatchToTopic(MarketMakerDispatcher.java:37)
                at com..fixgw.mdb.TgwMDB.onMessage(TgwMDB.java:39)
                at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:562)
                at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:500)
                at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:468)
                at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:326)
                at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:264)
                at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1071)
                at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1063)
                at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:960)
                at java.lang.Thread.run(Unknown Source)
      Jul 18, 2012 12:37:11 PM org.hornetq.core.logging.impl.JULLogDelegate error
      SEVERE: Failed to create netty connection
      java.net.BindException: Address already in use: connect
                at java.net.PlainSocketImpl.socketConnect(Native Method)
                at java.net.PlainSocketImpl.doConnect(Unknown Source)
                at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
                at java.net.PlainSocketImpl.connect(Unknown Source)
                at java.net.SocksSocketImpl.connect(Unknown Source)
                at java.net.Socket.connect(Unknown Source)
                at org.jboss.netty.channel.socket.oio.OioClientSocketPipelineSink.connect(OioClientSocketPipelineSink.java:114)
                at org.jboss.netty.channel.socket.oio.OioClientSocketPipelineSink.eventSunk(OioClientSocketPipelineSink.java:74)
                at org.jboss.netty.channel.Channels.connect(Channels.java:541)
                at org.jboss.netty.channel.AbstractChannel.connect(AbstractChannel.java:210)
                at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:227)
                at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188)
                at org.hornetq.core.remoting.impl.netty.NettyConnector.createConnection(NettyConnector.java:477)
                at org.hornetq.core.client.impl.ClientSessionFactoryImpl.getConnection(ClientSessionFactoryImpl.java:1144)
                at org.hornetq.core.client.impl.ClientSessionFactoryImpl.getConnectionWithRetry(ClientSessionFactoryImpl.java:994)
                at org.hornetq.core.client.impl.ClientSessionFactoryImpl.connect(ClientSessionFactoryImpl.java:225)
                at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:752)
                at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:601)
                at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:119)
                at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:114)
                at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)
                at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:456)
                at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:534)
                at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:526)
                at com..fixgw.beans.MarketMakerDispatcher.dispatchToTopic(MarketMakerDispatcher.java:24)
                at com..fixgw.mdb.TgwMDB.onMessage(TgwMDB.java:39)
                at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:562)
                at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:500)
                at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:468)
                at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:326)
                at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:264)
                at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1071)
                at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1063)
                at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:960)
                at java.lang.Thread.run(Unknown Source)
      

       

       

       

      Any idea how could I fix this?

       

      thanks,

      ray.