5 Replies Latest reply on Oct 2, 2009 7:38 AM by gmotts_gary.motts

    Camel-Receiving error java.util.concurrent.RejectedExecutionException

    gmotts_gary.motts

      Hi,

      I'm using Fuse v3.4.0.4 and Fuse MB 5.3.0.0 and have 2 service assemblies deployed to the ESB.  In SA #1 I have a camel route which defines a topic where messages are written into for consumption by other Service Assemblies.

       

      from("jbi:service:http://mynamespace/myService").to"activemq:topic:myTopic")

       

      In Service Asembly #2 - I define then durable subscriber (because I want no messages lost when SA #2 is offline)

       

          <jms:provider service="ABC:myTopicService"

              endpoint="myTopicEndpoint"

              pubSubDomain="true"

              destinationName="myTopic"

              connectionFactory="#connectionFactory"/>

       

          <jms:consumer service="ABC:myTopicDurableSubscriberService"

              endpoint="myTopicReader"

              targetService="ABC:myTopicSubscriber"

              clientId="myTopicConnector"

              pubSubDomain="true"

              transacted="none"

              cacheLevel="3"

              destinationName="myTopic"

              subscriptionDurable="true"

              durableSubscriptionName="myTopicReader"

              messageSelector="OriginatingApplication LIKE 'AS' AND Action LIKE 'Equipment%'"

              connectionFactory="#connectionFactory"/>

       

      The above consumer service in the above XBean has a targetService which calls my camel route named "myTopicSubscriber".  In my RouteBuilder class the following route is defined:

       

              from("jbi:service:http://mynamespace//myTopicSubscriber")

                  .convertBodyTo(String.class)

                  .setHeader("TargetComponent", constant("SA2"))

                  .to("activemq:queue:TEST");

       

      During normal program exeuction the above works well, messages are consumed and placed into the TEST queue and the selective durable subscriber functions as expected. Now when I shutdown SA #2 using the JMX console, messages continue to flow into the Topic queue.  However, wehn SA #2 is restarted, I get an error "java.util.concurrent.RejectedExecutionException" when the consumer attempts to call the Camel endpoint "jbi:service:http://mynamespace//myTopicSubscriber"

       

      Any help is appreciated.

       

      Thanks!

      -Gary

        • 1. Re: Camel-Receiving error java.util.concurrent.RejectedExecutionException
          stlewis

          Hey Gary, sounds like this could indeed be an issue that someone has run into before but has yet to be properly reproduced/logged, look here.  I'll see if I can reproduce this here with a simpler test.

           

          You could probably work around this easily enough, why not have the subscriber use a jms provider to publish to a queue, then read off of that queue from your camel route?

          • 2. Re: Camel-Receiving error java.util.concurrent.RejectedExecutionException
            davsclaus

            Thanks for reporting.

             

            I wonder if there is a glitch in the JBI component when its restarted. I will create a ticket so we have an engineer check the codebase.

            • 3. Re: Camel-Receiving error java.util.concurrent.RejectedExecutionException
              gmotts_gary.motts

              Hi, thanks for the fast response.

               

              As a follow-up I tried what you had suggested. I changed the subscriber to use a jms provider to publish to a queue, then read off of that queue from your camel route.  

               

              I then performed the following test:

               

              1) ServiceMix running - Message published to Topic queue and successfully read by the Subscriber, through the new queue and through the camel route.  Durable Subscriber showed 1 message dequeued, enqueed and dispatched and 0 messages pending as expected and the message was received in my test queue.

               

              2) SA #2 stopped via JMX console.  Message published to Topic queue and paused at the Subscriber.  The Durable Subscriber showed 0 messages dequeued, enqueed and dispatched and 1 message pending as expected.  No message was received in my test queue -- good so far.

               

              3) SA #3 started via JMX console.  Message delivered by the Subscriber into th new queue. However the message remained in the new queue and for whatever reason the Camel consumer route did not read the message from the queue.  This resolved the Concurrent Connection Error but did not fix my need to deliver the message through the camel route.

               

              -Gary

              • 4. Re: Camel-Receiving error java.util.concurrent.RejectedExecutionException
                njiang

                Hi,

                 

                Can you show me the stack trace of the RejectedExecutionException?

                It will be helpful for us to locate the key of the issue.

                 

                Thanks,

                 

                Willem

                • 5. Re: Camel-Receiving error java.util.concurrent.RejectedExecutionException
                  gmotts_gary.motts

                  Hi Willem, Here's the portion of the log file where the error occurred, highlighted in bold:

                   

                  2009-10-01 16:21:01,441, DEBUG, , , org.apache.servicemix.jbi.messaging.DeliveryChannelImpl - Notifying exchange ID:172.18.68.139-12411745426-11:6(1d91ed0) in DeliveryChannel{servicemix-jms} from processInboundSynchronousExchange

                  2009-10-01 16:21:01,441, DEBUG, , , org.apache.servicemix.jbi.messaging.DeliveryChannelImpl - Notified: ID:172.18.68.139-12411745426-11:6(1d91ed0) in DeliveryChannel{servicemix-jms} from sendSync

                  2009-10-01 16:21:01,348, DEBUG, , , org.apache.servicemix.camel.CamelJbiComponent - Received exchange: status: Active, role: provider

                  2009-10-01 16:21:01,441, DEBUG, , , org.apache.servicemix.camel.CamelJbiComponent - Retrieved correlation id: ID:172.18.68.139-12411745426-11:7

                  2009-10-01 16:21:01,488, DEBUG, , , org.apache.servicemix.camel.CamelJbiComponent - Received exchange: InOnly[

                    id: ID:172.18.68.139-12411745426-11:7

                    status: Active

                    role: provider

                    service: test

                    endpoint: camel172-18-68-139-12411745426-45-2

                    in:

                  ]

                  2009-10-01 16:21:01,520, DEBUG, , , org.apache.camel.processor.Pipeline - Message exchange has failed so breaking out of pipeline: Exchange[JbiMessage: NormalizedMessage@b89650(javax.xml.transform.dom.DOMSource@1c0193b)] exception: java.util.concurrent.RejectedExecutionException fault: null

                  2009-10-01 16:21:01,566, WARN , , , org.apache.servicemix.common.endpoints.SimpleEndpoint - SimpleEndpoint.fail called:

                  2009-10-01 16:21:01,566, DEBUG, , , org.apache.servicemix.jbi.messaging.DeliveryChannelImpl - Send ID:172.18.68.139-12411745426-11:7 in DeliveryChannel{servicemix-camel}

                  2009-10-01 16:21:01,566, DEBUG, , , org.apache.servicemix.jbi.security.SecuredBroker - send exchange with secure broker

                  2009-10-01 16:21:01,566, DEBUG, , , org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow - Called Flow send

                  2009-10-01 16:21:01,566, DEBUG, , , org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue - org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@12bafa2 dequeued exchange: InOnly[

                    id: ID:172.18.68.139-12411745426-11:7

                    status: Error

                    role: consumer

                    service: test

                    endpoint: camel172-18-68-139-12411745426-45-2

                    in:

                    error: java.util.concurrent.RejectedExecutionException

                  ]

                  2009-10-01 16:21:01,598, DEBUG, , , org.apache.servicemix.jbi.messaging.DeliveryChannelImpl - Notifying exchange ID:172.18.68.139-12411745426-11:7(1d1ff9f) in DeliveryChannel{servicemix-jms} from processInboundSynchronousExchange

                  2009-10-01 16:21:01,598, DEBUG, , , org.apache.servicemix.jbi.messaging.DeliveryChannelImpl - Notified: ID:172.18.68.139-12411745426-11:7(1d1ff9f) in DeliveryChannel{servicemix-jms} from sendSync

                   

                  -Gary