You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by hugberry <wo...@yahoo.com> on 2008/11/03 21:39:53 UTC
BindException in ActiveMQ in high volumn of messages
I am running a Spring Message Driven POJO example from
http://blog.springsource.com/2006/08/11/message-driven-pojos. The example
runs fine without problem until I change the client source code to send and
receive 1 million messages, after thousands of runs, I am getting a
bindException on the client. When I enable debug message on the broker,
the problem never shows up (Slowing it down seems to hide the issue). The
client, the broker, and the server are on the same Window XP machines, and
before the test I did confirm that none of the port that AMQ required are
used.
The error after 4031 iterations:
:
:
:
auto4027: Confirmed #4127
auto4028: Confirmed #4128
auto4029: Confirmed #4129
auto4030: Not Confirmed
auto4031: Confirmed #4131
Exception in thread "main"
org.springframework.jms.UncategorizedJmsException: Un
categorized exception occured during JMS processing; nested exception is
javax.j
ms.JMSException: Could not connect to broker URL: tcp://localhost:61616.
Reason:
java.net.BindException: Address already in use: connect; nested exception
is ja
va.net.BindException: Address already in use: connect
at
org.springframework.jms.support.JmsUtils.convertJmsAccessException(Jm
sUtils.java:292)
at
org.springframework.jms.support.JmsAccessor.convertJmsAccessException
(JmsAccessor.java:168)
at
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474
)
at
org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:539)
at
org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.j
ava:617)
at
org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.j
ava:609)
at blog.mdp.RegistrationConsole.main(RegistrationConsole.java:32)
Caused by: javax.jms.JMSException: Could not connect to broker URL:
tcp://localh
ost:61616. Reason: java.net.BindException: Address already in use: connect
at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSuppo
rt.java:35)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnectio
n(ActiveMQConnectionFactory.java:278)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnectio
n(ActiveMQConnectionFactory.java:222)
at
org.apache.activemq.ActiveMQConnectionFactory.createConnection(Active
MQConnectionFactory.java:170)
at
org.springframework.jms.support.JmsAccessor.createConnection(JmsAcces
sor.java:184)
at
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:461
)
... 4 more
Caused by: 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.apache.activemq.transport.tcp.TcpTransport.connect(TcpTransport.j
ava:414)
at
org.apache.activemq.transport.tcp.TcpTransport.doStart(TcpTransport.j
ava:380)
at
org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:50)
at
org.apache.activemq.transport.TransportFilter.start(TransportFilter.j
ava:57)
at
org.apache.activemq.transport.TransportFilter.start(TransportFilter.j
ava:57)
at
org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNe
gotiator.java:72)
at
org.apache.activemq.transport.TransportFilter.start(TransportFilter.j
ava:57)
at
org.apache.activemq.transport.TransportFilter.start(TransportFilter.j
ava:57)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnectio
n(ActiveMQConnectionFactory.java:258)
... 8 more
I am kind of hoping to show ActiveMQ to my colleage is ready for Production
use. Anyone have an idea of troubleshooting this?
Thanks.
--
View this message in context: http://www.nabble.com/BindException-in-ActiveMQ-in-high-volumn-of-messages-tp20310367p20310367.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: BindException in ActiveMQ in high volumn of messages
Posted by hugberry <wo...@yahoo.com>.
Thanks for the great hint. I am able to resolve the issues and getting a
significant gain in performance by doing this:
<!-- >bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616"/>
</bean -->
<bean id="connectionFactory"
class="org.apache.activemq.pool.PooledConnectionFactory">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616" />
</bean>
</property>
</bean>
Joe Fernandez wrote:
>
> Somehow the system ends up using a port that hasn't had a chance to get
> cleaned up from the previous run. When you add a delay, the system has a
> chance to clean it up.
>
> It looks like the sample MDP is using the JmsTemplate. So you may want to
> take a look at the JmsTemplate gotchas.
>
> http://activemq.apache.org/jmstemplate-gotchas.html
>
> If you're sending and receiving 1M messages, you're not going to want to
> open and close a heavyweight connection object for each and every
> operation.
>
> Joe
> http://www.ttmsolutions.com - get a free ActiveMQ user guide
>
>
>
> hugberry wrote:
>>
>> I am running a Spring Message Driven POJO example from
>> http://blog.springsource.com/2006/08/11/message-driven-pojos. The
>> example runs fine without problem until I change the client source code
>> to send and receive 1 million messages, after thousands of runs, I am
>> getting a bindException on the client. When I enable debug message on
>> the broker, the problem never shows up (Slowing it down seems to hide the
>> issue). The client, the broker, and the server are on the same Window
>> XP machine, and before the test I did confirm that none of the port that
>> AMQ required are used.
>>
>> The error after 4031 iterations:
>>
>> :
>> :
>> :
>> auto4027: Confirmed #4127
>> auto4028: Confirmed #4128
>> auto4029: Confirmed #4129
>> auto4030: Not Confirmed
>> auto4031: Confirmed #4131
>> Exception in thread "main"
>> org.springframework.jms.UncategorizedJmsException: Un
>> categorized exception occured during JMS processing; nested exception is
>> javax.j
>> ms.JMSException: Could not connect to broker URL: tcp://localhost:61616.
>> Reason:
>> java.net.BindException: Address already in use: connect; nested
>> exception is ja
>> va.net.BindException: Address already in use: connect
>> at
>> org.springframework.jms.support.JmsUtils.convertJmsAccessException(Jm
>> sUtils.java:292)
>> at
>> org.springframework.jms.support.JmsAccessor.convertJmsAccessException
>> (JmsAccessor.java:168)
>> at
>> org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474
>> )
>> at
>> org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:539)
>> at
>> org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.j
>> ava:617)
>> at
>> org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.j
>> ava:609)
>> at blog.mdp.RegistrationConsole.main(RegistrationConsole.java:32)
>> Caused by: javax.jms.JMSException: Could not connect to broker URL:
>> tcp://localh
>> ost:61616. Reason: java.net.BindException: Address already in use:
>> connect
>> at
>> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSuppo
>> rt.java:35)
>> at
>> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnectio
>> n(ActiveMQConnectionFactory.java:278)
>> at
>> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnectio
>> n(ActiveMQConnectionFactory.java:222)
>> at
>> org.apache.activemq.ActiveMQConnectionFactory.createConnection(Active
>> MQConnectionFactory.java:170)
>> at
>> org.springframework.jms.support.JmsAccessor.createConnection(JmsAcces
>> sor.java:184)
>> at
>> org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:461
>> )
>> ... 4 more
>> Caused by: 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.apache.activemq.transport.tcp.TcpTransport.connect(TcpTransport.j
>> ava:414)
>> at
>> org.apache.activemq.transport.tcp.TcpTransport.doStart(TcpTransport.j
>> ava:380)
>> at
>> org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:50)
>>
>> at
>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.j
>> ava:57)
>> at
>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.j
>> ava:57)
>> at
>> org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNe
>> gotiator.java:72)
>> at
>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.j
>> ava:57)
>> at
>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.j
>> ava:57)
>> at
>> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnectio
>> n(ActiveMQConnectionFactory.java:258)
>> ... 8 more
>>
>> I am kind of hoping to show ActiveMQ to my colleage is ready for
>> Production use. Anyone have an idea of troubleshooting this?
>>
>> Thanks.
>>
>>
>
>
--
View this message in context: http://www.nabble.com/BindException-in-ActiveMQ-in-high-volumn-of-messages-tp20310367p20312238.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: BindException in ActiveMQ in high volumn of messages
Posted by Joe Fernandez <jo...@ttmsolutions.com>.
Somehow the system ends up using a port that hasn't had a chance to get
cleaned up from the previous run. When you add a delay, the system has a
chance to clean it up.
It looks like the sample MDP is using the JmsTemplate. So you may want to
take a look at the JmsTemplate gotchas.
http://activemq.apache.org/jmstemplate-gotchas.html
If you're sending and receiving 1M messages, you're not going to want to
open and close a heavyweight connection object for each and every operation.
Joe
http://www.ttmsolutions.com - get a free ActiveMQ user guide
hugberry wrote:
>
> I am running a Spring Message Driven POJO example from
> http://blog.springsource.com/2006/08/11/message-driven-pojos. The example
> runs fine without problem until I change the client source code to send
> and receive 1 million messages, after thousands of runs, I am getting a
> bindException on the client. When I enable debug message on the broker,
> the problem never shows up (Slowing it down seems to hide the issue).
> The client, the broker, and the server are on the same Window XP machine,
> and before the test I did confirm that none of the port that AMQ required
> are used.
>
> The error after 4031 iterations:
>
> :
> :
> :
> auto4027: Confirmed #4127
> auto4028: Confirmed #4128
> auto4029: Confirmed #4129
> auto4030: Not Confirmed
> auto4031: Confirmed #4131
> Exception in thread "main"
> org.springframework.jms.UncategorizedJmsException: Un
> categorized exception occured during JMS processing; nested exception is
> javax.j
> ms.JMSException: Could not connect to broker URL: tcp://localhost:61616.
> Reason:
> java.net.BindException: Address already in use: connect; nested exception
> is ja
> va.net.BindException: Address already in use: connect
> at
> org.springframework.jms.support.JmsUtils.convertJmsAccessException(Jm
> sUtils.java:292)
> at
> org.springframework.jms.support.JmsAccessor.convertJmsAccessException
> (JmsAccessor.java:168)
> at
> org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474
> )
> at
> org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:539)
> at
> org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.j
> ava:617)
> at
> org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.j
> ava:609)
> at blog.mdp.RegistrationConsole.main(RegistrationConsole.java:32)
> Caused by: javax.jms.JMSException: Could not connect to broker URL:
> tcp://localh
> ost:61616. Reason: java.net.BindException: Address already in use: connect
> at
> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSuppo
> rt.java:35)
> at
> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnectio
> n(ActiveMQConnectionFactory.java:278)
> at
> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnectio
> n(ActiveMQConnectionFactory.java:222)
> at
> org.apache.activemq.ActiveMQConnectionFactory.createConnection(Active
> MQConnectionFactory.java:170)
> at
> org.springframework.jms.support.JmsAccessor.createConnection(JmsAcces
> sor.java:184)
> at
> org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:461
> )
> ... 4 more
> Caused by: 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.apache.activemq.transport.tcp.TcpTransport.connect(TcpTransport.j
> ava:414)
> at
> org.apache.activemq.transport.tcp.TcpTransport.doStart(TcpTransport.j
> ava:380)
> at
> org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:50)
>
> at
> org.apache.activemq.transport.TransportFilter.start(TransportFilter.j
> ava:57)
> at
> org.apache.activemq.transport.TransportFilter.start(TransportFilter.j
> ava:57)
> at
> org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNe
> gotiator.java:72)
> at
> org.apache.activemq.transport.TransportFilter.start(TransportFilter.j
> ava:57)
> at
> org.apache.activemq.transport.TransportFilter.start(TransportFilter.j
> ava:57)
> at
> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnectio
> n(ActiveMQConnectionFactory.java:258)
> ... 8 more
>
> I am kind of hoping to show ActiveMQ to my colleage is ready for
> Production use. Anyone have an idea of troubleshooting this?
>
> Thanks.
>
>
--
View this message in context: http://www.nabble.com/BindException-in-ActiveMQ-in-high-volumn-of-messages-tp20310367p20311220.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: BindException in ActiveMQ in high volumn of messages
Posted by hugberry <wo...@yahoo.com>.
Thanks for the great hint/pointer. I am able to resolve the issues and
getting a significant gain in performance by doing this:
<!-- >bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616"/>
</bean -->
<bean id="connectionFactory"
class="org.apache.activemq.pool.PooledConnectionFactory">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616" />
</bean>
</property>
</bean>
--
View this message in context: http://www.nabble.com/BindException-in-ActiveMQ-in-high-volumn-of-messages-tp20310367p20312407.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.