You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Geoffry Roberts <ge...@gmail.com> on 2011/09/10 00:21:11 UTC

Is the vm:// prorocol Supported in Karaf?

All,

I have a blueprint file that works if I use tcp:// protocol but does not
work if I use vm:// all else being equal.
Is the vm protocol supported?

My blueprint file, which I drop into the deploy directory (See below.)
queues messages nicely if I use tcp. Of course, everything is running in the
same jvm.

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
    <bean id="jms"
class="org.apache.activemq.camel.component.ActiveMQComponent">
        <!-- This works. --> <property name="brokerURL"
value="tcp://localhost:61616" />
        <!-- This does not work. <property name="brokerURL"
value="vm://localhost:61616" />  -->
    </bean>
    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
        <route>
            <from uri="timer:test?period=5000" />
            <setBody>
                <constant>Ave Mundus!!</constant>
            </setBody>
            <to uri="jms:queue:ave" />
        </route>
    </camelContext>
</blueprint>

Thanks
-- 
Geoffry Roberts

Re: Is the vm:// prorocol Supported in Karaf?

Posted by Geoffry Roberts <ge...@gmail.com>.
Thanks for the explanation, clearly I wasn't making the proper
distinction between vm and tcp.

As I said above, when I use the tcp protocol, I do get messages in the
proper queue on my activemq broker.  But I am not able to consume them
on a remote machine.  I have Karaf running remotely and am using a
blueprint that has  the  the jms routing in the <from> element.  The
blueprint shows as active in the remote Karaf, but in the ActiveMQ
broker no consumers are listed, and of course no messages are being
consumed.

Can you shed an light on the following? It is the blueprint from my
remote machine.

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
    <bean id="jms"
class="org.apache.activemq.camel.component.ActiveMQComponent">
        <property name="brokerURL" value="tcp://active_mq_host:61616" />
    </bean>
    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
        <route>
            <from uri="jms:queue:ave" />
            <to uri="some uri" />
        </route>
    </camelContext>
</blueprint>


On 9 September 2011 22:49, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>
> Hi Geoffry,
>
> the Camel vm:// protocol (in the Camel core) is supported.
>
> But your usage is not correct.
>
> The vm: component provides asynchronous SEDA behavior so that messages are exchanged on a BlockingQueue and consumers are invoked in a separate thread pool to the producer.
>
> It's used to communicate between two routes in the same JVM.
>
> It's not designed to use a TCP connection.
>
> Regards
> JB
>
> On 09/10/2011 12:21 AM, Geoffry Roberts wrote:
>>
>> All,
>>
>> I have a blueprint file that works if I use tcp:// protocol but does not
>> work if I use vm:// all else being equal.
>> Is the vm protocol supported?
>>
>> My blueprint file, which I drop into the deploy directory (See below.)
>> queues messages nicely if I use tcp. Of course, everything is running in
>> the same jvm.
>>
>> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
>> <bean id="jms"
>> class="org.apache.activemq.camel.component.ActiveMQComponent">
>> <!-- This works. --> <property name="brokerURL"
>> value="tcp://localhost:61616" />
>> <!-- This does not work. <property name="brokerURL"
>> value="vm://localhost:61616" />  -->
>> </bean>
>> <camelContext xmlns="http://camel.apache.org/schema/blueprint">
>> <route>
>> <from uri="timer:test?period=5000" />
>> <setBody>
>> <constant>Ave Mundus!!</constant>
>> </setBody>
>> <to uri="jms:queue:ave" />
>> </route>
>> </camelContext>
>> </blueprint>
>>
>> Thanks
>> --
>> Geoffry Roberts
>>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com



--
Geoffry Roberts

Re: Is the vm:// prorocol Supported in Karaf?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Geoffry,

the Camel vm:// protocol (in the Camel core) is supported.

But your usage is not correct.

The vm: component provides asynchronous SEDA behavior so that messages 
are exchanged on a BlockingQueue and consumers are invoked in a separate 
thread pool to the producer.

It's used to communicate between two routes in the same JVM.

It's not designed to use a TCP connection.

Regards
JB

On 09/10/2011 12:21 AM, Geoffry Roberts wrote:
> All,
>
> I have a blueprint file that works if I use tcp:// protocol but does not
> work if I use vm:// all else being equal.
> Is the vm protocol supported?
>
> My blueprint file, which I drop into the deploy directory (See below.)
> queues messages nicely if I use tcp. Of course, everything is running in
> the same jvm.
>
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
> <bean id="jms"
> class="org.apache.activemq.camel.component.ActiveMQComponent">
> <!-- This works. --> <property name="brokerURL"
> value="tcp://localhost:61616" />
> <!-- This does not work. <property name="brokerURL"
> value="vm://localhost:61616" />  -->
> </bean>
> <camelContext xmlns="http://camel.apache.org/schema/blueprint">
> <route>
> <from uri="timer:test?period=5000" />
> <setBody>
> <constant>Ave Mundus!!</constant>
> </setBody>
> <to uri="jms:queue:ave" />
> </route>
> </camelContext>
> </blueprint>
>
> Thanks
> --
> Geoffry Roberts
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Is the vm:// prorocol Supported in Karaf?

Posted by Gareth <ga...@gmail.com>.
Hello Geoffry

Are you sure that vm URL is right? Shouldn't it just be:

vm://localhost  (not vm://localhost:61616)

What error do you see in the log?

regards,
Gareth



--
View this message in context: http://karaf.922171.n3.nabble.com/Is-the-vm-prorocol-Supported-in-Karaf-tp3324263p3324467.html
Sent from the Karaf - User mailing list archive at Nabble.com.