I will look into this over the weekend and will let you know. My client and
server are both using a single connection (I'm using a
SingleConnectionFactory), the client only uses one session, the server uses
a session per thread. It's when the server is run with 6 or more threads I
get problems.




James.Strachan wrote:
> 
> So first off, ActiveMQ supports auto-reconnection to avoid things
> hanging if for whatever reason a socket is closed by your OS /
> hardware /network
> 
> http://activemq.apache.org/how-can-i-support-auto-reconnection.html
> 
> Also each Connection created in ActiveMQ tends to create a socket and
> a thread on the broker side. So you could increase the parallelism of
> your client while reducing load on the broker by just creating a
> single connection and reusing it across many sessions in your client.
> 
> 
> On 2/2/07, Paul French <[EMAIL PROTECTED]> wrote:
>>
>> Hello,
>>
>> I have a single client laptop that connects to the broker on another
>> machine, creates a temp queue and sends text messages to a main queue.
>> The
>> client also starts a listener consumer to consume the replies given on
>> the
>> temp queue.
>>
>> The server consumes messages from the main queue does some processing and
>> then replies on the temp queue.
>>
>> The server runs with a pre-configured number of threads. Each thread does
>> the following:
>>
>>     connection = connectionFactory.createConnection();
>>     session = connection.createSession(false,Session.CLIENT_ACKNOWLEDGE);
>>     consumer = session.createConsumer(mainQueueName);
>>     producer = session.createProducer(null); // set as null since we do
>> not
>> know the destination until runtime
>>     connection.start();
>>
>> The connection details are as follows:
>>
>>   <bean id="connectionFactory"
>> class="org.springframework.jms.connection.SingleConnectionFactory"
>> destroy-method="destroy">
>>     <property name="targetConnectionFactory">
>>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>>         <property name="brokerURL"
>> value="tcp://localhost:61616?jms.prefetchPolicy.queuePrefetch=1" />
>>         <property name="useAsyncSend"><value>TRUE</value></property>
>>       </bean>
>>     </property>
>>   </bean>
>>
>> When I run with 6 threads I'm usually okay. When I run the server above 7
>> threads I get the following Exception
>>
>> Async exception with no exception listener: java.net.SocketException:
>> Broken
>> pipe
>> java.net.SocketException: Broken pipe
>>         at java.net.SocketOutputStream.socketWrite0(Native Method)
>>         at
>> java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
>>         at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
>>         at
>> org.apache.activemq.transport.tcp.TcpBufferedOutputStream.flush(TcpBu
>> fferedOutputStream.java:109)
>>         at java.io.DataOutputStream.flush(DataOutputStream.java:106)
>>         at
>> org.apache.activemq.transport.tcp.TcpTransport.oneway(TcpTransport.ja
>> va:119)
>>         at
>> org.apache.activemq.transport.InactivityMonitor.writeCheck(Inactivity
>> Monitor.java:81)
>>         at
>> org.apache.activemq.transport.InactivityMonitor.access$100(Inactivity
>> Monitor.java:35)
>>         at
>> org.apache.activemq.transport.InactivityMonitor$2.run(InactivityMonit
>> or.java:57)
>>         at
>> edu.emory.mathcs.backport.java.util.concurrent.Executors$RunnableAdap
>> ter.call(Executors.java:431)
>>         at
>> edu.emory.mathcs.backport.java.util.concurrent.FutureTask.runAndReset
>> (FutureTask.java:198)
>>         at
>> edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExe
>> cutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:189)
>>         at
>> edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExe
>> cutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:213)
>>         at
>> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor
>> ker.runTask(ThreadPoolExecutor.java:650)
>>         at
>> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor
>> ker.run(ThreadPoolExecutor.java:675)
>>         at java.lang.Thread.run(Thread.java:595)
>>
>>
>> Once I get this exception no threads can process any messages. Any ideas?
>> What does this Exception message imply? I am running ActiveMQ 4.1.0.
>>
>> The server machine I am using supports 24 simultaneous threads and I want
>> to
>> get up to this number since each server request takes considerable time
>> to
>> process and is highly computational.
>>
>> I am running the broker on the server at the moment. In the meantime I
>> will
>> move the broker on to a different machine to see if that alliviates the
>> problem.
>> --
>> View this message in context:
>> http://www.nabble.com/Async-Exception%3A-Broken-Pipe-tf3160498.html#a8765808
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Async-Exception%3A-Broken-Pipe-tf3160498.html#a8776891
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to