[
https://issues.apache.org/activemq/browse/AMQ-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61554#action_61554
]
Nuno Valente commented on AMQ-2883:
-----------------------------------
Daniel,
We had the same problem and because we have lots of Stomp Clients (a couple of
hundred), we implemented a workaround with StompConnect.
Since ActiveMQ 5.4.0 solves a lot of issues (and brings camel 2.4) in 5.3.2
that had impact in our applications we have upgraded our instances use
StompConnect instead of somp(+nio) transport connector.
To implement this solution, you just need the StompConnect jar (available at
Codehaus) in your class path, and use the following Spring configuration
outside of your broker context:
<bean id="myFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616"/
<property name="userName" value="username"/>
<property name="password" value="password"/>
</bean>
<bean id="stompConnector" class="org.codehaus.stomp.jms.StompConnect"
init-method="start">
<property name="connectionFactory" ref="myFactory"/>
<property name="uri" value="tcp://localhost:61612"/>
</bean>
This way you comment your stomp+nio transport connector and leave the forward
to your desired ip/port. (this example assumes a user named "user" and password
"password". Also assumes that your Stomp messages are heading to
localhost:61612 and that the openwire transport connector listens in
localhost:61616)
Hope this helps.
Best regards,
Nuno Valente.
> EOFException if stomp+nio after ActiveMQ has sent the first bytes message
> -------------------------------------------------------------------------
>
> Key: AMQ-2883
> URL: https://issues.apache.org/activemq/browse/AMQ-2883
> Project: ActiveMQ
> Issue Type: Bug
> Components: Transport
> Affects Versions: 5.4.0
> Environment: Windows Vista
> Reporter: Michael Justin
> Assignee: Timothy Bish
> Fix For: 5.4.1
>
>
> Starting broker with C:\Java\apache-activemq-5.4.0\bin\activemq-admin.bat
> start xbean:activemq-stomp.xml
> The Stomp client sends a number of binary messages but receives only the
> first one, the broker log on the console looks like this:
> Java Runtime: Sun Microsystems Inc. 1.6.0_07 C:\Program
> Files\Java\jdk1.6.0_07\j
> re
> Heap sizes: current=5056k free=4360k max=520256k
> JVM args: -Dcom.sun.management.jmxremote -Xmx512M
> -Dorg.apache.activemq.UseD
> edicatedTaskRunner=true -Djava.util.logging.config.file=logging.properties
> -Dact
> ivemq.classpath=C:\Java\apache-activemq-5.4.0\bin\../conf;
> -Dactivemq.home=C:\Ja
> va\apache-activemq-5.4.0\bin\..
> -Dactivemq.base=C:\Java\apache-activemq-5.4.0\bi
> n\..
> ACTIVEMQ_HOME: C:\Java\apache-activemq-5.4.0\bin\..
> ACTIVEMQ_BASE: C:\Java\apache-activemq-5.4.0\bin\..
> Loading message broker from: xbean:activemq-stomp.xml
> INFO |
> PListStore:C:\Java\apache-activemq-5.4.0\bin\..\data\localhost\tmp_stora
> ge started
> INFO | Using Persistence Adapter:
> KahaDBPersistenceAdapter[C:\Java\apache-activ
> emq-5.4.0\bin\..\data\kahadb]
> INFO | ActiveMQ 5.4.0 JMS Message Broker (localhost) is starting
> INFO | For help or more information please see: http://activemq.apache.org/
> INFO | Scheduler using directory: activemq-data\scheduler
> INFO | Listening for connections at:
> stomp://mj-PC:61612?transport.closeAsync=f
> alse
> INFO | Connector stomp Started
> INFO | Listening for connections at:
> stomp+nio://mj-PC:61613?transport.closeAsy
> nc=false
> INFO | Connector stomp+nio Started
> INFO | ActiveMQ JMS Message Broker (localhost,
> ID:mj-PC-49520-1283080154792-0:0
> ) started
> INFO | Logging to
> org.slf4j.impl.JCLLoggerAdapter(org.eclipse.jetty.util.log) v
> ia org.eclipse.jetty.util.log.Slf4jLog
> INFO | jetty-7.0.1.v20091125
> INFO | ActiveMQ WebConsole initialized.
> INFO | Initializing Spring FrameworkServlet 'dispatcher'
> INFO | ActiveMQ Console at http://0.0.0.0:8161/admin
> INFO | Initializing Spring root WebApplicationContext
> INFO | Connector vm://localhost Started
> INFO | Camel Console at http://0.0.0.0:8161/camel
> INFO | ActiveMQ Web Demos at http://0.0.0.0:8161/demo
> INFO | RESTful file access application at http://0.0.0.0:8161/fileserver
> INFO | Started [email protected]:8161
> INFO | Transport failed: java.io.EOFException
> java.io.EOFException
> at
> org.apache.activemq.transport.stomp.StompNIOTransport.serviceRead(Sto
> mpNIOTransport.java:106)
> at
> org.apache.activemq.transport.stomp.StompNIOTransport.access$000(Stom
> pNIOTransport.java:51)
> at
> org.apache.activemq.transport.stomp.StompNIOTransport$1.onSelect(Stom
> pNIOTransport.java:80)
> at
> org.apache.activemq.transport.nio.SelectorSelection.onSelect(Selector
> Selection.java:94)
> at
> org.apache.activemq.transport.nio.SelectorWorker$1.run(SelectorWorker
> .java:119)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
> utor.java:885)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
> .java:907)
> at java.lang.Thread.run(Thread.java:619)
> The Stomp client log is:
> TCoreIndyTests.TestBytesMessages
> send:
> CONNECT
> received:
> CONNECTED
> session:ID:mj-PC-49520-1283080154792-5:0
> send:
> SUBSCRIBE
> destination:/queue/HabariSpeedTest
> ack:auto
> id:{E4BD9658-B92E-4C57-AD9F-F5357BA66FC2}
> send:
> SEND
> destination:/queue/HabariSpeedTest
> content-length:4
> correlation-id:{5B735F2D-349E-4A8A-B2AE-6493A1569F88}
> ☺☻♥1
> send:
> SEND
> destination:/queue/HabariSpeedTest
> content-length:4
> correlation-id:{5B735F2D-349E-4A8A-B2AE-6493A1569F88}
> ☺☻♥2
> send:
> (more messages, ten total)
> received:
> MESSAGE
> message-id:ID:mj-PC-49520-1283080154792-5:0:-1:1:1
> destination:/queue/HabariSpeedTest
> timestamp:1283080192048
> expires:0
> subscription:{E4BD9658-B92E-4C57-AD9F-F5357BA66FC2}
> content-length:4
> priority:0
> correlation-id:{5B735F2D-349E-4A8A-B2AE-6493A1569F88}
> ☺☻♥1
> Received 1 messages
> Elapsed: 10000 msec (limit: 10000 msec) - giving up
> send:
> DISCONNECT
> Not sure if this is related but I also see an error in the startup log on
> later restarts. I reinstalled the broker and the message disappears.
> INFO | jetty-7.0.1.v20091125
> INFO | ActiveMQ WebConsole initialized.
> INFO | Initializing Spring FrameworkServlet 'dispatcher'
> INFO | ActiveMQ Console at http://0.0.0.0:8161/admin
> INFO | Initializing Spring root WebApplicationContext
> ERROR | Could not accept connection :
> java.nio.channels.ClosedSelectorException <------------------
> INFO | Connector vm://localhost Started
> INFO | Camel Console at http://0.0.0.0:8161/camel
> INFO | ActiveMQ Web Demos at http://0.0.0.0:8161/demo
> INFO | RESTful file access application at http://0.0.0.0:8161/fileserver
> INFO | Started [email protected]:8161
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.