You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by mmistroni <mm...@gmail.com> on 2008/02/17 18:44:20 UTC

ActiveMQ issue / can this be achieved

hi all,
  i am using servicemix standalone.
I have deployed componets that allow me to do this:

filePoller--->MiddleComponentSE-->FinalDestinationSE.
this has been achieved using eip:pipeline

I am now trying to achieve this
JMS BC --> MiddleComponentSE-->FinalDestinationSE, againg using eip:pipeline

this is my JMS-bu  xbean.xml
[code]
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
       xmlns:test="http://test"
       xmlns:amq="http://activemq.org/config/1.0"
       xmlns:tut="urn:servicemix:tutorial"
       xmlns:eip="http://servicemix.apache.org/eip/1.0">

    <!-- START SNIPPET: consumer -->
    <jms:endpoint service="test:MyConsumerService"
                  endpoint="jms"
                  targetService="tut:wiretap"
                  role="consumer" 
                  destinationStyle="queue"
                  jmsProviderDestinationName="queue/A"
                  connectionFactory="#connectionFactory" />
    <!-- END SNIPPET: provider -->

    <amq:connectionFactory id="connectionFactory"
brokerURL="tcp://localhost:61616" />

    <!-- JMS ConnectionFactory from JNDI -
    <bean id="connectionFactory"
class="org.springframework.jndi.JndiObjectFactoryBean">
      <property name="jndiName" value="ConnectionFactory" />
    </bean>
    -->

</beans>
[/code]

for testing purposes, i have written a JMS client which posts messages to
the JMS queue, so that i can test the whole flow
here' smy JMS client code
[code]
try {
			ActiveMQConnectionFactory factory = new
			ActiveMQConnectionFactory("tcp://localhost:61616");
			ActiveMQQueue pubTopic = new ActiveMQQueue("queue/A");
			Connection connection = factory.createConnection();
			Session session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
			MessageProducer producer = session.createProducer(pubTopic);
			producer.send(pubTopic,session.createTextMessage("<test>This is a simple
test</test>"));
			System.err.println("--- Message successfully sent-----");
		} catch(Exception e) {
			System.err.println("Exception in sending message.");
			e.printStackTrace();
		}
[/code]

whenever i run my client, i got this exception from svcmix
[code]
INFO  - LogTask                        - Logging system reconfigured using
file:
 file:/C:/apache-servicemix-3.3-SNAPSHOT/conf/log4j.xml
ERROR - JmsComponent                   - Error processing exchange InOut[
  id: ID:192.168.0.2-1182878fc24-13:0
  status: Error
  role: consumer
  service: {urn:servicemix:tutorial}wiretap
  endpoint: endpoint
  in: <?xml version="1.0" encoding="UTF-8"?><test>This is a simple
test</test>
  error: java.lang.UnsupportedOperationException: Use an InOnly or
RobustInOnly
MEP
]
java.lang.UnsupportedOperationException: A destination must be specified.
        at
org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProdu
cer.java:448)
        at
org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProdu
cer.java:356)
        at
org.apache.servicemix.jms.multiplexing.MultiplexingConsumerProcessor.
process(MultiplexingConsumerProcessor.java:120)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLi
feCycle.java:538)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async
BaseLifeCycle.java:512)
        at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLife
Cycle.java:46)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
d(DeliveryChannelImpl.java:610)
        at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
w.java:170)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
ava:167)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
a:134)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:650)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:675)
[/code]

what am i missing?
my understanding is that my BC is just a 'listener' to a queue, so if i post
a message to that queue the BC should pick it up and pass it thru to the
pipeline.....

anyone could help?

thanks and regards
 marco













  
-- 
View this message in context: http://www.nabble.com/ActiveMQ-issue---can-this-be-achieved-tp15531004s12049p15531004.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: ActiveMQ issue / can this be achieved

Posted by mmistroni <mm...@gmail.com>.
Hello
  i sorted out  the problem
i changed  xbean.xml from this one:

<jms:endpoint service="test:MyConsumerService"
                  endpoint="jms"
                  targetService="tut:pipeline"
                  role="consumer" 
                  destinationStyle="queue"
                  jmsProviderDestinationName="queue/A"
                  connectionFactory="#connectionFactory"/>

to this one

<jms:endpoint service="test:MyConsumerService"
                  endpoint="jms"
                  targetService="tut:pipeline"
                  role="consumer" 
                  destinationStyle="queue"
                  jmsProviderDestinationName="queue/A"
                  connectionFactory="#connectionFactory"
                  defaultMep="http://www.w3.org/2004/08/wsdl/in-only"/>

and everything worked as a charm :)

sorry for bothering.... i feel i should fight with code for 3 days before
posting :)

regards
  marco






mmistroni wrote:
> 
> hi all,
>   i am using servicemix standalone.
> I have deployed componets that allow me to do this:
> 
> filePoller--->MiddleComponentSE-->FinalDestinationSE.
> this has been achieved using eip:pipeline
> 
> I am now trying to achieve this
> JMS BC --> MiddleComponentSE-->FinalDestinationSE, againg using
> eip:pipeline
> 
> this is my JMS-bu  xbean.xml
> [code]
> <beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
>        xmlns:test="http://test"
>        xmlns:amq="http://activemq.org/config/1.0"
>        xmlns:tut="urn:servicemix:tutorial"
>        xmlns:eip="http://servicemix.apache.org/eip/1.0">
> 
>     <!-- START SNIPPET: consumer -->
>     <jms:endpoint service="test:MyConsumerService"
>                   endpoint="jms"
>                   targetService="tut:wiretap"
>                   role="consumer" 
>                   destinationStyle="queue"
>                   jmsProviderDestinationName="queue/A"
>                   connectionFactory="#connectionFactory" />
>     <!-- END SNIPPET: provider -->
> 
>     <amq:connectionFactory id="connectionFactory"
> brokerURL="tcp://localhost:61616" />
> 
>     <!-- JMS ConnectionFactory from JNDI -
>     <bean id="connectionFactory"
> class="org.springframework.jndi.JndiObjectFactoryBean">
>       <property name="jndiName" value="ConnectionFactory" />
>     </bean>
>     -->
> 
> </beans>
> [/code]
> 
> for testing purposes, i have written a JMS client which posts messages to
> the JMS queue, so that i can test the whole flow
> here' smy JMS client code
> [code]
> try {
> 			ActiveMQConnectionFactory factory = new
> 			ActiveMQConnectionFactory("tcp://localhost:61616");
> 			ActiveMQQueue pubTopic = new ActiveMQQueue("queue/A");
> 			Connection connection = factory.createConnection();
> 			Session session = connection.createSession(false,
> Session.AUTO_ACKNOWLEDGE);
> 			MessageProducer producer = session.createProducer(pubTopic);
> 			producer.send(pubTopic,session.createTextMessage("<test>This is a
> simple test</test>"));
> 			System.err.println("--- Message successfully sent-----");
> 		} catch(Exception e) {
> 			System.err.println("Exception in sending message.");
> 			e.printStackTrace();
> 		}
> [/code]
> 
> whenever i run my client, i got this exception from svcmix
> [code]
> INFO  - LogTask                        - Logging system reconfigured using
> file:
>  file:/C:/apache-servicemix-3.3-SNAPSHOT/conf/log4j.xml
> ERROR - JmsComponent                   - Error processing exchange InOut[
>   id: ID:192.168.0.2-1182878fc24-13:0
>   status: Error
>   role: consumer
>   service: {urn:servicemix:tutorial}wiretap
>   endpoint: endpoint
>   in: <?xml version="1.0" encoding="UTF-8"?><test>This is a simple
> test</test>
>   error: java.lang.UnsupportedOperationException: Use an InOnly or
> RobustInOnly
> MEP
> ]
> java.lang.UnsupportedOperationException: A destination must be specified.
>         at
> org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProdu
> cer.java:448)
>         at
> org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProdu
> cer.java:356)
>         at
> org.apache.servicemix.jms.multiplexing.MultiplexingConsumerProcessor.
> process(MultiplexingConsumerProcessor.java:120)
>         at
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLi
> feCycle.java:538)
>         at
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async
> BaseLifeCycle.java:512)
>         at
> org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLife
> Cycle.java:46)
>         at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
> d(DeliveryChannelImpl.java:610)
>         at
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
> w.java:170)
>         at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
> ava:167)
>         at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
> a:134)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
> utor.java:650)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
> .java:675)
> [/code]
> 
> what am i missing?
> my understanding is that my BC is just a 'listener' to a queue, so if i
> post a message to that queue the BC should pick it up and pass it thru to
> the pipeline.....
> 
> anyone could help?
> 
> thanks and regards
>  marco
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>   
> 

-- 
View this message in context: http://www.nabble.com/ActiveMQ-issue---can-this-be-achieved-tp15531004s12049p15663531.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: ActiveMQ issue / can this be achieved

Posted by mmistroni <mm...@gmail.com>.
Bruce,
      yes that was misleading.. i was actually naming service wiretap while
instead it was eip pipeline.
I got same problem again....  
i am sure the eip:pipeline is fine because i have also a file BC which sends
messages to my eip:pipeline, and everything works fine... i must be doing
something wrong either in my jms client or in the config of my jms BC
Anway, here are files

**** JMS BC  xbean.xml  ***************
[code]
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
       xmlns:test="http://test"
       xmlns:amq="http://activemq.org/config/1.0"
       xmlns:tut="urn:servicemix:tutorial"
       xmlns:eip="http://servicemix.apache.org/eip/1.0">

    <!-- START SNIPPET: consumer -->
    <jms:endpoint service="test:MyConsumerService"
                  endpoint="jms"
                  targetService="tut:pipeline"
                  role="consumer" 
                  destinationStyle="queue"
                  jmsProviderDestinationName="queue/A"
                  connectionFactory="#connectionFactory" />
    <!-- END SNIPPET: provider -->

    <amq:connectionFactory id="connectionFactory"
brokerURL="tcp://localhost:61616" />


</beans>
[/code]

**** eip:pipeline xbean.xml
[code]
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<beans xmlns:eip="http://servicemix.apache.org/eip/1.0"
       xmlns:tut="urn:servicemix:tutorial"
       xmlns:hwse="http://org.apache.servicemix.samples.helloworld.se/1.0" 
       xmlns:xyz="http://companyxyz.com"
       xmlns:final="http://org.apache.servicemix.samples.finalprovider/1.0" 
       xmlns:prov="http://finalprovider.working..com">
    
  
  <eip:pipeline service="tut:pipeline" endpoint="endpoint">
    <eip:transformer>
      <eip:exchange-target service="prov:finalProvider"
endpoint="finalProvider" />
    </eip:transformer>
    <eip:target>
      <eip:exchange-target service="xyz:helloWorld" 
               endpoint="helloWorld" />
    </eip:target>
  </eip:pipeline>
[/code]  


**** jms client ******
[code]
public class JMSClient
{
    public static void main( String[] args )
    {
        try {
			ActiveMQConnectionFactory factory = new
			ActiveMQConnectionFactory("tcp://localhost:61616");
			//ActiveMQQueue pubTopic = new ActiveMQQueue("queue/A");
			Connection connection = factory.createConnection();
			Session session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
			Queue pubQueue = session.createQueue("queue/A");
			MessageProducer producer = session.createProducer(pubQueue);
			producer.send(pubQueue,session.createTextMessage("<test>This is a simple
test</test>"));
			System.err.println("--- Message successfully sent-----");
		} catch(Exception e) {
			System.err.println("Exception in sending message.");
			e.printStackTrace();
		}

    }
}
[/code]

here's exception again
[code]
ERROR - JmsComponent                   - Error processing exchange InOut[
  id: ID:192.168.0.2-1184b52b010-13:0
  status: Error
  role: consumer
  service: {urn:servicemix:tutorial}pipeline
  endpoint: endpoint
  in: <?xml version="1.0" encoding="UTF-8"?><test>This is a simple
test</test>
  error: java.lang.UnsupportedOperationException: Use an InOnly or
RobustInOnly
MEP
]
java.lang.UnsupportedOperationException: A destination must be specified.
        at
org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProdu
cer.java:448)
        at
org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProdu
cer.java:356)
        at
org.apache.servicemix.jms.multiplexing.MultiplexingConsumerProcessor.
process(MultiplexingConsumerProcessor.java:120)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLi
feCycle.java:538)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async
BaseLifeCycle.java:512)
        at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLife
Cycle.java:46)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
d(DeliveryChannelImpl.java:610)
        at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
w.java:170)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
ava:167)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
a:134)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:650)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:675)
        at java.lang.Thread.run(Thread.java:595)
ERROR - JmsComponent                   - Error setting exchange status to
ERROR
javax.jbi.messaging.MessagingException: illegal call to send / sendSync
        at
org.apache.servicemix.jbi.messaging.MessageExchangeImpl.handleSend(Me
ssageExchangeImpl.java:614)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(Delive
ryChannelImpl.java:385)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.send(Delivery
ChannelImpl.java:431)
        at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLife
Cycle.java:58)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
d(DeliveryChannelImpl.java:610)
        at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
w.java:170)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
ava:167)
[/code]


can u give me some hints on where the problem might be?

As said, if i use a file BC, whole flow works fine...

thanks and regards
  marco











> On Feb 17, 2008 10:44 AM, mmistroni <mm...@gmail.com> wrote:
>>
>> hi all,
>>   i am using servicemix standalone.
>> I have deployed componets that allow me to do this:
>>
>> filePoller--->MiddleComponentSE-->FinalDestinationSE.
>> this has been achieved using eip:pipeline
>>
>> I am now trying to achieve this
>> JMS BC --> MiddleComponentSE-->FinalDestinationSE, againg using
>> eip:pipeline
>>
>> this is my JMS-bu  xbean.xml
>> [code]
>> <beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
>>        xmlns:test="http://test"
>>        xmlns:amq="http://activemq.org/config/1.0"
>>        xmlns:tut="urn:servicemix:tutorial"
>>        xmlns:eip="http://servicemix.apache.org/eip/1.0">
>>
>>     <!-- START SNIPPET: consumer -->
>>     <jms:endpoint service="test:MyConsumerService"
>>                   endpoint="jms"
>>                   targetService="tut:wiretap"
>>                   role="consumer"
>>                   destinationStyle="queue"
>>                   jmsProviderDestinationName="queue/A"
>>                   connectionFactory="#connectionFactory" />
>>     <!-- END SNIPPET: provider -->
>>
>>     <amq:connectionFactory id="connectionFactory"
>> brokerURL="tcp://localhost:61616" />
>>
>>     <!-- JMS ConnectionFactory from JNDI -
>>     <bean id="connectionFactory"
>> class="org.springframework.jndi.JndiObjectFactoryBean">
>>       <property name="jndiName" value="ConnectionFactory" />
>>     </bean>
>>     -->
>>
>> </beans>
>> [/code]
>>
>> for testing purposes, i have written a JMS client which posts messages to
>> the JMS queue, so that i can test the whole flow
>> here' smy JMS client code
>> [code]
>> try {
>>                         ActiveMQConnectionFactory factory = new
>>                        
>> ActiveMQConnectionFactory("tcp://localhost:61616");
>>                         ActiveMQQueue pubTopic = new
>> ActiveMQQueue("queue/A");
>>                         Connection connection =
>> factory.createConnection();
>>                         Session session = connection.createSession(false,
>> Session.AUTO_ACKNOWLEDGE);
>>                         MessageProducer producer =
>> session.createProducer(pubTopic);
>>                        
>> producer.send(pubTopic,session.createTextMessage("<test>This is a simple
>> test</test>"));
>>                         System.err.println("--- Message successfully
>> sent-----");
>>                 } catch(Exception e) {
>>                         System.err.println("Exception in sending
>> message.");
>>                         e.printStackTrace();
>>                 }
>> [/code]
>>
>> whenever i run my client, i got this exception from svcmix
>> [code]
>> INFO  - LogTask                        - Logging system reconfigured
>> using
>> file:
>>  file:/C:/apache-servicemix-3.3-SNAPSHOT/conf/log4j.xml
>> ERROR - JmsComponent                   - Error processing exchange InOut[
>>   id: ID:192.168.0.2-1182878fc24-13:0
>>   status: Error
>>   role: consumer
>>   service: {urn:servicemix:tutorial}wiretap
>>   endpoint: endpoint
>>   in: <?xml version="1.0" encoding="UTF-8"?><test>This is a simple
>> test</test>
>>   error: java.lang.UnsupportedOperationException: Use an InOnly or
>> RobustInOnly
>> MEP
>> ]
>> java.lang.UnsupportedOperationException: A destination must be specified.
>>         at
>> org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProdu
>> cer.java:448)
>>         at
>> org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProdu
>> cer.java:356)
>>         at
>> org.apache.servicemix.jms.multiplexing.MultiplexingConsumerProcessor.
>> process(MultiplexingConsumerProcessor.java:120)
>>         at
>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLi
>> feCycle.java:538)
>>         at
>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async
>> BaseLifeCycle.java:512)
>>         at
>> org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLife
>> Cycle.java:46)
>>         at
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
>> d(DeliveryChannelImpl.java:610)
>>         at
>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
>> w.java:170)
>>         at
>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
>> ava:167)
>>         at
>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
>> a:134)
>>         at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
>> utor.java:650)
>>         at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
>> .java:675)
>> [/code]
>>
>> what am i missing?
>> my understanding is that my BC is just a 'listener' to a queue, so if i
>> post
>> a message to that queue the BC should pick it up and pass it thru to the
>> pipeline.....
>>
>> anyone could help?
> 
> You say you're using a pipeline, but the service to which you're
> sending is named wiretap. Please post the configuration for the next
> component which, based on its name would appear to be a wiretap.
> 
> Also, more importantly, based on the following exception:
> 
> java.lang.UnsupportedOperationException: A destination must be specified.
>        at
> org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProdu
> cer.java:448)
> 
> The destination you're using in the call to the send() method is null.
> Instead of creating a queue using new ActiveMQQueue(), you should
> create a queue by calling session.createQueue().
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> Apache ActiveMQ - http://activemq.org/
> Apache Camel - http://activemq.org/camel/
> Apache ServiceMix - http://servicemix.org/
> Apache Geronimo - http://geronimo.apache.org/
> 
> Blog: http://bruceblog.org/
> 
> 

-- 
View this message in context: http://www.nabble.com/ActiveMQ-issue---can-this-be-achieved-tp15531004s12049p15663433.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: ActiveMQ issue / can this be achieved

Posted by Bruce Snyder <br...@gmail.com>.
On Feb 17, 2008 10:44 AM, mmistroni <mm...@gmail.com> wrote:
>
> hi all,
>   i am using servicemix standalone.
> I have deployed componets that allow me to do this:
>
> filePoller--->MiddleComponentSE-->FinalDestinationSE.
> this has been achieved using eip:pipeline
>
> I am now trying to achieve this
> JMS BC --> MiddleComponentSE-->FinalDestinationSE, againg using eip:pipeline
>
> this is my JMS-bu  xbean.xml
> [code]
> <beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
>        xmlns:test="http://test"
>        xmlns:amq="http://activemq.org/config/1.0"
>        xmlns:tut="urn:servicemix:tutorial"
>        xmlns:eip="http://servicemix.apache.org/eip/1.0">
>
>     <!-- START SNIPPET: consumer -->
>     <jms:endpoint service="test:MyConsumerService"
>                   endpoint="jms"
>                   targetService="tut:wiretap"
>                   role="consumer"
>                   destinationStyle="queue"
>                   jmsProviderDestinationName="queue/A"
>                   connectionFactory="#connectionFactory" />
>     <!-- END SNIPPET: provider -->
>
>     <amq:connectionFactory id="connectionFactory"
> brokerURL="tcp://localhost:61616" />
>
>     <!-- JMS ConnectionFactory from JNDI -
>     <bean id="connectionFactory"
> class="org.springframework.jndi.JndiObjectFactoryBean">
>       <property name="jndiName" value="ConnectionFactory" />
>     </bean>
>     -->
>
> </beans>
> [/code]
>
> for testing purposes, i have written a JMS client which posts messages to
> the JMS queue, so that i can test the whole flow
> here' smy JMS client code
> [code]
> try {
>                         ActiveMQConnectionFactory factory = new
>                         ActiveMQConnectionFactory("tcp://localhost:61616");
>                         ActiveMQQueue pubTopic = new ActiveMQQueue("queue/A");
>                         Connection connection = factory.createConnection();
>                         Session session = connection.createSession(false,
> Session.AUTO_ACKNOWLEDGE);
>                         MessageProducer producer = session.createProducer(pubTopic);
>                         producer.send(pubTopic,session.createTextMessage("<test>This is a simple
> test</test>"));
>                         System.err.println("--- Message successfully sent-----");
>                 } catch(Exception e) {
>                         System.err.println("Exception in sending message.");
>                         e.printStackTrace();
>                 }
> [/code]
>
> whenever i run my client, i got this exception from svcmix
> [code]
> INFO  - LogTask                        - Logging system reconfigured using
> file:
>  file:/C:/apache-servicemix-3.3-SNAPSHOT/conf/log4j.xml
> ERROR - JmsComponent                   - Error processing exchange InOut[
>   id: ID:192.168.0.2-1182878fc24-13:0
>   status: Error
>   role: consumer
>   service: {urn:servicemix:tutorial}wiretap
>   endpoint: endpoint
>   in: <?xml version="1.0" encoding="UTF-8"?><test>This is a simple
> test</test>
>   error: java.lang.UnsupportedOperationException: Use an InOnly or
> RobustInOnly
> MEP
> ]
> java.lang.UnsupportedOperationException: A destination must be specified.
>         at
> org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProdu
> cer.java:448)
>         at
> org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProdu
> cer.java:356)
>         at
> org.apache.servicemix.jms.multiplexing.MultiplexingConsumerProcessor.
> process(MultiplexingConsumerProcessor.java:120)
>         at
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLi
> feCycle.java:538)
>         at
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async
> BaseLifeCycle.java:512)
>         at
> org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLife
> Cycle.java:46)
>         at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
> d(DeliveryChannelImpl.java:610)
>         at
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
> w.java:170)
>         at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
> ava:167)
>         at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
> a:134)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
> utor.java:650)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
> .java:675)
> [/code]
>
> what am i missing?
> my understanding is that my BC is just a 'listener' to a queue, so if i post
> a message to that queue the BC should pick it up and pass it thru to the
> pipeline.....
>
> anyone could help?

You say you're using a pipeline, but the service to which you're
sending is named wiretap. Please post the configuration for the next
component which, based on its name would appear to be a wiretap.

Also, more importantly, based on the following exception:

java.lang.UnsupportedOperationException: A destination must be specified.
       at
org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProdu
cer.java:448)

The destination you're using in the call to the send() method is null.
Instead of creating a queue using new ActiveMQQueue(), you should
create a queue by calling session.createQueue().

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/