You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Lou Parisi <Lo...@photomask.com> on 2009/04/21 05:24:46 UTC

ActiveMQ BlobMessage with ServiceMix

I have a pojo component I created that can send files using ActiveMQ
BlobMessage from FtpFilePoller.  It uses FTP URL to send message to
destination queue as BlobMessage type.  This works fine and is what I will
use in production but for local development it would be easier to send using
a local file but AMQ requires Jetty to to send a local file as a
BlobMessage.  In the AMQ distribution, the Jetty server is started as part
of the JMS broker but I haven't been able to get it to work in ServiceMix. 
I can send a local file using BlobMessage with standalone app and standalone
AMQ broker with default configuration but I can't get it to work in
ServiceMix.  

Does anyone have information that would help me get the Jetty server running
for AMQ BlobMessages in ServiceMix?

I tried adding the Jetty configuration in activemq.xml from the AMQ
distribution to the AMQ configuration in servicemix (along with required
libraries) but I couldn't get it to work.  Got error message that
servicemix-jms could not start.
-- 
View this message in context: http://www.nabble.com/ActiveMQ-BlobMessage-with-ServiceMix-tp23148590p23148590.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: ActiveMQ BlobMessage with ServiceMix

Posted by Ashwin Karpe <as...@progress.com>.
Hi Lou,

Have you tried taking the jetty fragment from activemq.xml in AMQ and
putting it in the activemq.xml file in the conf directory of Servicemix.
This should start up the Jetty component since the functionality is present
in activemq-core.jar (see fragment below).

While the fragment is used to configure the web console, there is no reason
why it could not be used for other purposes. BTW, the ActiveMQ in Servicemix
is the full version and you can take advantage of any AMQ capability
including the jetty plugin... 

Hope this is what you are looking for...

Cheers,

Ashwin...

=========================================================================

  <!-- An embedded servlet engine for serving up the Admin console -->
  <jetty xmlns="http://mortbay.com/schemas/jetty/1.0">
    <connectors>
      <nioConnector port="8161" />
    </connectors>

    <handlers>
      <webAppContext contextPath="/admin"
resourceBase="${activemq.base}/webapps/admin" logUrlOnStart="true" />
      <webAppContext contextPath="/demo"
resourceBase="${activemq.base}/webapps/demo" logUrlOnStart="true" />
    </handlers>
  </jetty>
=========================================================================

Lou Parisi wrote:
> 
> Hi Ashwin,
> Thanks for your reply.  I am able to send and consume a BlobMessage in
> servicemix.  I wrote a custom POJO component to send the BlobMessage to a
> queue and then a JMSMarshaler to read it from the queue and write out to
> the local file system.
> 
> There are several ways to create a blob message in AMQ.  One is to use an
> FTP URL to specify the file to send.  In that case AMQ uses the FTP server
> to send the message.  This is what I have working.
> 
> It is also possible to send a blob message specifying a java.io.File.  In
> this case AMQ has an embedded Jetty server to serve the file.  The Jetty
> server is started when you startup the AMQ broker using the default
> settings in the AMQ distribution.  I would like to get the same
> functionality in servicemix because it would be easier for local
> development and testing to be able to run this way.  I am trying to figure
> out how to configure AMQ in servicemix so this functionality is available.
> 
> 
> 
> Ashwin Karpe wrote:
>> 
>> 
>> Servicemix only supports XML based messages. If you need Servicemix to
>> consume a BlobMessage, ensure that it is wrapped with a dummy tag such as
>> <data></data>. Then it will be consumed without problems.
>> 
>> 
> 
> 


-----
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
---- 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: http://www.nabble.com/ActiveMQ-BlobMessage-with-ServiceMix-tp23148590p23175409.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: ActiveMQ BlobMessage with ServiceMix

Posted by Ashwin Karpe <as...@progress.com>.
Hi Lou,

Have you tried taking the jetty fragment from activemq.xml in AMQ and
putting it in the activemq.xml file in the conf directory of Servicemix.
This should start up the Jetty component since the functionality is present
in activemq-core.jar (see fragment below).

While the fragment is used to configure the web console, there is no reason
why it could not be used for other purposes. BTW, the ActiveMQ in Servicemix
is the full version and you can take advantage of any AMQ capability
including the jetty plugin... 

Hope this is what you are looking for...

Cheers,

Ashwin...

=========================================================================

  <!-- An embedded servlet engine for serving up the Admin console -->
  <jetty xmlns="http://mortbay.com/schemas/jetty/1.0">
    <connectors>
      <nioConnector port="8161" />
    </connectors>

    <handlers>
      <webAppContext contextPath="/admin"
resourceBase="${activemq.base}/webapps/admin" logUrlOnStart="true" />
      <webAppContext contextPath="/demo"
resourceBase="${activemq.base}/webapps/demo" logUrlOnStart="true" />
    </handlers>
  </jetty>
=========================================================================

Lou Parisi wrote:
> 
> Hi Ashwin,
> Thanks for your reply.  I am able to send and consume a BlobMessage in
> servicemix.  I wrote a custom POJO component to send the BlobMessage to a
> queue and then a JMSMarshaler to read it from the queue and write out to
> the local file system.
> 
> There are several ways to create a blob message in AMQ.  One is to use an
> FTP URL to specify the file to send.  In that case AMQ uses the FTP server
> to send the message.  This is what I have working.
> 
> It is also possible to send a blob message specifying a java.io.File.  In
> this case AMQ has an embedded Jetty server to serve the file.  The Jetty
> server is started when you startup the AMQ broker using the default
> settings in the AMQ distribution.  I would like to get the same
> functionality in servicemix because it would be easier for local
> development and testing to be able to run this way.  I am trying to figure
> out how to configure AMQ in servicemix so this functionality is available.
> 
> 
> 
> Ashwin Karpe wrote:
>> 
>> 
>> Servicemix only supports XML based messages. If you need Servicemix to
>> consume a BlobMessage, ensure that it is wrapped with a dummy tag such as
>> <data></data>. Then it will be consumed without problems.
>> 
>> 
> 
> 


-----
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
---- 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: http://www.nabble.com/ActiveMQ-BlobMessage-with-ServiceMix-tp23148590p23175408.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: ActiveMQ BlobMessage with ServiceMix

Posted by Lou Parisi <Lo...@photomask.com>.
Hi Ashwin,
Thanks for your reply.  I am able to send and consume a BlobMessage in
servicemix.  I wrote a custom POJO component to send the BlobMessage to a
queue and then a JMSMarshaler to read it from the queue and write out to the
local file system.

There are several ways to create a blob message in AMQ.  One is to use an
FTP URL to specify the file to send.  In that case AMQ uses the FTP server
to send the message.  This is what I have working.

It is also possible to send a blob message specifying a java.io.File.  In
this case AMQ has an embedded Jetty server to serve the file.  The Jetty
server is started when you startup the AMQ broker using the default settings
in the AMQ distribution.  I would like to get the same functionality in
servicemix because it would be easier for local development and testing to
be able to run this way.  I am trying to figure out how to configure AMQ in
servicemix so this functionality is available.



Ashwin Karpe wrote:
> 
> 
> Servicemix only supports XML based messages. If you need Servicemix to
> consume a BlobMessage, ensure that it is wrapped with a dummy tag such as
> <data></data>. Then it will be consumed without problems.
> 
> 

-- 
View this message in context: http://www.nabble.com/ActiveMQ-BlobMessage-with-ServiceMix-tp23148590p23154976.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: ActiveMQ BlobMessage with ServiceMix

Posted by Ashwin Karpe <as...@progress.com>.
Hi,

Servicemix only supports XML based messages. If you need Servicemix to
consume a BlobMessage, ensure that it is wrapped with a dummy tag such as
<data></data>. Then it will be consumed without problems.

Obviously you will need to strip out the tag when it is sent beyond the
boundaries of Servicemix.

Cheers,

Ashwin...


Lou Parisi wrote:
> 
> I have a pojo component I created that can send files using ActiveMQ
> BlobMessage from FtpFilePoller.  It uses FTP URL to send message to
> destination queue as BlobMessage type.  This works fine and is what I will
> use in production but for local development it would be easier to send
> using a local file but AMQ requires Jetty to to send a local file as a
> BlobMessage.  In the AMQ distribution, the Jetty server is started as part
> of the JMS broker but I haven't been able to get it to work in ServiceMix. 
> I can send a local file using BlobMessage with standalone app and
> standalone AMQ broker with default configuration but I can't get it to
> work in ServiceMix.  
> 
> Does anyone have information that would help me get the Jetty server
> running for AMQ BlobMessages in ServiceMix?
> 
> I tried adding the Jetty configuration in activemq.xml from the AMQ
> distribution to the AMQ configuration in servicemix (along with required
> libraries) but I couldn't get it to work.  Got error message that
> servicemix-jms could not start.
> 


-----
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
---- 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: http://www.nabble.com/ActiveMQ-BlobMessage-with-ServiceMix-tp23148590p23154606.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.