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

  • JmsTemplate issue (javax.jms.JMSException:


    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:
    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:
    org.springframework.jms.UncategorizedJmsException: Uncategorized exception occured during JMS processing; nested exception is javax.jms.JMSException:
    at sAccessException(
    at tJmsAccessException(
    at org.springframework.jms.core.JmsTemplate.execute(J
    at org.apache.camel.component.jms.JmsConfiguration$Ca melJmsTemplate.send(
    at org.apache.camel.component.jms.JmsProducer.doSend(
    at org.apache.camel.component.jms.JmsProducer.process InOnly(
    at org.apache.camel.component.jms.JmsProducer.process (
    at org.apache.camel.impl.converter.AsyncProcessorType Converter$ProcessorToAsyncProcessorBridge.process(
    at org.apache.camel.util.AsyncProcessorHelper.process (
    at org.apache.camel.processor.SendProcessor$2.doInAsy ncProducer(
    at org.apache.camel.impl.ProducerCache.doInAsyncProdu cer(
    at org.apache.camel.processor.SendProcessor.process(S
    .................................................. ...............................................
    at org.apache.camel.processor.Pipeline.process(Pipeli
    at org.apache.camel.processor.Pipeline.process(Pipeli
    at cess(
    at org.apache.camel.util.AsyncProcessorHelper.process (
    at org.apache.camel.processor.DelegateAsyncProcessor. processNext(
    at org.apache.camel.processor.DelegateAsyncProcessor. process(
    at or.process(
    at org.apache.camel.component.file.GenericFileConsume r.processExchange(
    at org.apache.camel.component.file.GenericFileConsume r.processBatch(
    at org.apache.camel.component.file.GenericFileConsume r.poll(
    at java.util.concurrent.Executors$ 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 Source)
    at java.util.concurrent.ThreadPoolExecutor$ Task(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$ (Unknown Source)
    at Source)
    Caused by: javax.jms.JMSException:
    at org.apache.activemq.util.JMSExceptionSupport.creat e(
    at org.apache.activemq.ActiveMQConnection.syncSendPac ket(
    at org.apache.activemq.ActiveMQConnection.ensureConne ctionInfoSent(
    at org.apache.activemq.ActiveMQConnection.createSessi on(
    at Session(
    at org.springframework.jms.core.JmsTemplate.execute(J
    ... 144 more
    Caused by:
    at Source)
    at org.apache.activemq.openwire.OpenWireFormat.unmars hal(
    at org.apache.activemq.transport.tcp.TcpTransport.rea dCommand(
    at org.apache.activemq.transport.tcp.TcpTransport.doR un(
    at (
    ... 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.