Announcement Announcement Module
Collapse
No announcement yet.
JmsTemplate issue (javax.jms.JMSException: java.io.EOFException) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JmsTemplate issue (javax.jms.JMSException: java.io.EOFException)

    Hello,

    I'm using Apache Fuse ESB with Apache Camel 2.4.0 and Spring 3.0.3 to process some large files. The ActiveMQ 5.5.0 broker comes with ServiceMix and it's almost a basic configuration. The architecture looks something like this:
    1. service unit that reads lines from a file and sends each line within the exchange's out body
    2. service unit 2 that takes the line from the previous exchange, transforms it into an xml and sends the xml within the exchange's out body
    3. service unit 3 that takes the xml, transforms it into another xml and sends the xml
    4. service unit 4 that takes the final xml, unmarshals it into an object, inserts the object into the db and sends a final exchange to a service that checks if it's the end of the file or not
    5. service unit 5 that resets a flag if it's the end of the file

    This architecture was working fine but had a "minor" problem, the insert/update operations into the db(service unit 4) were extremely slow, it would take more than 3 hours to handle 18.000 lines from the initial file. In the end I found out that there is a parameter that must be set "sendStringParametersAsUnicode=false" in order to improve the performance when working with Sql Server 2000+.

    After setting this parameter on the jdbc driver url the performance did increase dramatically, the db operations would take less than 1 second, from more than 50 seconds before. But an exception showed up and I have no idea how to solve it.

    This is the current configuration for the queues that Apache Camel uses to communicate from one service unit to the next one:
    <amqolicyEntry queue=">" producerFlowControl="true" memoryLimit="256kb">

    With this configuration, when I add "sendStringParametersAsUnicode=false" I get the EOFException after integrating about 7000 lines. If I switch it to:
    <amqolicyEntry queue=">" producerFlowControl="true" memoryLimit="512mb">
    I can process around 10000 lines but I still get the Exception.

    If I increase memoryLimit to 1mb or more I get another exception, saying that servicemix can't reach the broker on port 62626 because there is another binding on that port already, which is nonsense, because there is nothing for sure.

    I'm running the basic configuration, with 256kb, on my local machine, which is like 3 times faster, and I can't crash the broker and get any exception, no matter how much I try.

    He had the same problem and solved it, but I don't understand his point:
    http://camel.465427.n5.nabble.com/ha...86p472003.html
    This problem was solved by loosening the configuration of ActiveMQ to allow for fast producers.
    I suspect that this is an ActiveMQ problem, the broker simply closes a connection, but I don't understand why or where. Here is the complete stacktrace:
    ERROR | Camel Thread 0 - file:///d:/activesmx/inbox | DefaultErrorHandler | .apache.camel.processor.Logger 248 | Failed delivery for exchangeId: 3889e287-a8aa-475c-b377-26a6963c19d2. Exhausted after delivery attempt: 1 caught: org.springframework.jms.UncategorizedJmsException: Uncategorized exception occured during JMS processing; nested exception is javax.jms.JMSException: java.io.EOFException
    org.springframework.jms.UncategorizedJmsException: Uncategorized exception occured during JMS processing; nested exception is javax.jms.JMSException: java.io.EOFException
    at org.springframework.jms.support.JmsUtils.convertJm sAccessException(JmsUtils.java:316)
    at org.springframework.jms.support.JmsAccessor.conver tJmsAccessException(JmsAccessor.java:168)
    at org.springframework.jms.core.JmsTemplate.execute(J msTemplate.java:469)
    at org.apache.camel.component.jms.JmsConfiguration$Ca melJmsTemplate.send(JmsConfiguration.java:195)
    at org.apache.camel.component.jms.JmsProducer.doSend( JmsProducer.java:375)
    at org.apache.camel.component.jms.JmsProducer.process InOnly(JmsProducer.java:320)
    at org.apache.camel.component.jms.JmsProducer.process (JmsProducer.java:150)
    at org.apache.camel.impl.converter.AsyncProcessorType Converter$ProcessorToAsyncProcessorBridge.process( AsyncProcessorTypeConverter.java:50)
    at org.apache.camel.util.AsyncProcessorHelper.process (AsyncProcessorHelper.java:70)
    at org.apache.camel.processor.SendProcessor$2.doInAsy ncProducer(SendProcessor.java:104)
    at org.apache.camel.impl.ProducerCache.doInAsyncProdu cer(ProducerCache.java:272)
    at org.apache.camel.processor.SendProcessor.process(S endProcessor.java:98)
    .................................................. ...............................................
    at org.apache.camel.processor.Pipeline.process(Pipeli ne.java:143)
    at org.apache.camel.processor.Pipeline.process(Pipeli ne.java:78)
    at org.apache.camel.processor.UnitOfWorkProcessor.pro cess(UnitOfWorkProcessor.java:99)
    at org.apache.camel.util.AsyncProcessorHelper.process (AsyncProcessorHelper.java:70)
    at org.apache.camel.processor.DelegateAsyncProcessor. processNext(DelegateAsyncProcessor.java:98)
    at org.apache.camel.processor.DelegateAsyncProcessor. process(DelegateAsyncProcessor.java:89)
    at org.apache.camel.management.InstrumentationProcess or.process(InstrumentationProcessor.java:68)
    at org.apache.camel.component.file.GenericFileConsume r.processExchange(GenericFileConsumer.java:322)
    at org.apache.camel.component.file.GenericFileConsume r.processBatch(GenericFileConsumer.java:153)
    at org.apache.camel.component.file.GenericFileConsume r.poll(GenericFileConsumer.java:119)
    at org.apache.camel.impl.ScheduledPollConsumer.run(Sc heduledPollConsumer.java:98)
    at java.util.concurrent.Executors$RunnableAdapter.cal l(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerRunAndRe set(Unknown Source)
    at java.util.concurrent.FutureTask.runAndReset(Unknow n Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.access$101(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.runPeriodic(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: javax.jms.JMSException: java.io.EOFException
    at org.apache.activemq.util.JMSExceptionSupport.creat e(JMSExceptionSupport.java:49)
    at org.apache.activemq.ActiveMQConnection.syncSendPac ket(ActiveMQConnection.java:1296)
    at org.apache.activemq.ActiveMQConnection.ensureConne ctionInfoSent(ActiveMQConnection.java:1393)
    at org.apache.activemq.ActiveMQConnection.createSessi on(ActiveMQConnection.java:310)
    at org.springframework.jms.support.JmsAccessor.create Session(JmsAccessor.java:196)
    at org.springframework.jms.core.JmsTemplate.execute(J msTemplate.java:457)
    ... 144 more
    Caused by: java.io.EOFException
    at java.io.DataInputStream.readInt(Unknown Source)
    at org.apache.activemq.openwire.OpenWireFormat.unmars hal(OpenWireFormat.java:276)
    at org.apache.activemq.transport.tcp.TcpTransport.rea dCommand(TcpTransport.java:230)
    at org.apache.activemq.transport.tcp.TcpTransport.doR un(TcpTransport.java:222)
    at org.apache.activemq.transport.tcp.TcpTransport.run (TcpTransport.java:205)
    ... 1 more

  • #2
    Sorry for not getting to this sooner. We are in the process of moving to StackOverflow for our forums.

    This question is probably a better candidate for StackOverflow, perhaps against the #spring-jms, #apahce-fuse tag.
    If you do post it there, please reply here with the link.

    Thanks!

    Comment

    Working...
    X