You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by "Wendell L. Hatcher" <we...@gmail.com> on 2013/08/29 20:23:24 UTC

Copy Message from queue to a text file.

Is it possible to copy a single message from a queue to a text file? 



--
View this message in context: http://activemq.2283324.n4.nabble.com/Copy-Message-from-queue-to-a-text-file-tp4670925.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Copy Message from queue to a text file.

Posted by "Steve.V." <st...@sas.com>.
The following is a sample SAS program that puts a message on a queue, then
gets it off and writes it to a flat file:

/* Assign a fileref to the queue. */
filename myq ActiveMQ user=admin pass=admin
    URL='http://localhost:8161/api/message/mytestq?type=queue';

/* Put a message on a queue named "mytestq" */
data _null_; file myq; put 'This just a text message.'; run;
 
/* GET the message off the queue and write it to "flat.txt". */
data _null_; file 'flat.txt'; infile myq; input; put _infile_; run;



-----
Stephen Vincent
--
View this message in context: http://activemq.2283324.n4.nabble.com/Copy-Message-from-queue-to-a-text-file-tp4670925p4670938.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Copy Message from queue to a text file.

Posted by "Wendell L. Hatcher" <we...@gmail.com>.
Thank you this helps me come up with a game plan to solve my problem.


On Thu, Aug 29, 2013 at 6:19 PM, ceposta [via ActiveMQ] <
ml-node+s2283324n4670937h0@n4.nabble.com> wrote:

> ActiveMQ is a messaging broker that moves messages from system A to system
> B. You can do whatever you like with the message once it's arrived. Use
> Apache Camel to consume and print to a text file. Or use the JMS APis
> directly. Or a stomp client, etc, etc....
>
>
> On Thu, Aug 29, 2013 at 2:21 PM, Wendell L. Hatcher <
> [hidden email] <http://user/SendEmail.jtp?type=node&node=4670937&i=0>>
> wrote:
>
> > Just take one message consume and print to a text file.  Is this
> possible
> > in activemq?
> >
> >
> > On Thu, Aug 29, 2013 at 4:45 PM, ceposta [via ActiveMQ] <
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=4670937&i=1>>
> wrote:
> >
> > > not sure what you mean.
> > > like you have a queue of 5 messages, and you want to "extract" one and
> > > print that to a text file? or you just want to consume one message and
> > > print that to a file? your best bet might be to look at apache camel.
> > > doing
> > > this would be dead simple.
> > >
> > >
> > > On Thu, Aug 29, 2013 at 11:23 AM, Wendell L. Hatcher <
> > > [hidden email] <http://user/SendEmail.jtp?type=node&node=4670933&i=0>>
>
> > > wrote:
> > >
> > > > Is it possible to copy a single message from a queue to a text file?
> > > >
> > > >
> > > >
> > > > --
> > > > View this message in context:
> > > >
> > >
> >
> http://activemq.2283324.n4.nabble.com/Copy-Message-from-queue-to-a-text-file-tp4670925.html
> > > > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> > > >
> > >
> > >
> > >
> > > --
> > > *Christian Posta*
> > > http://www.christianposta.com/blog
> > > twitter: @christianposta
> > >  http://www.christianposta.com/blog
> > >
> > >
> > > ------------------------------
> > >  If you reply to this email, your message will be added to the
> discussion
> > > below:
> > >
> > >
> >
> http://activemq.2283324.n4.nabble.com/Copy-Message-from-queue-to-a-text-file-tp4670925p4670933.html
> > >  To unsubscribe from Copy Message from queue to a text file., click
> here<
> >
> >
> > > .
> > > NAML<
> >
> http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>
> > >
> > >
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://activemq.2283324.n4.nabble.com/Copy-Message-from-queue-to-a-text-file-tp4670925p4670935.html
>
> > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >
>
>
>
> --
> *Christian Posta*
> http://www.christianposta.com/blog
> twitter: @christianposta
>  http://www.christianposta.com/blog
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://activemq.2283324.n4.nabble.com/Copy-Message-from-queue-to-a-text-file-tp4670925p4670937.html
>  To unsubscribe from Copy Message from queue to a text file., click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4670925&code=d2VuZGVsbGhhdGNoZXIxMDc0QGdtYWlsLmNvbXw0NjcwOTI1fC02MzcxNDI1MjU=>
> .
> NAML<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://activemq.2283324.n4.nabble.com/Copy-Message-from-queue-to-a-text-file-tp4670925p4670981.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Copy Message from queue to a text file.

Posted by Christian Posta <ch...@gmail.com>.
ActiveMQ is a messaging broker that moves messages from system A to system
B. You can do whatever you like with the message once it's arrived. Use
Apache Camel to consume and print to a text file. Or use the JMS APis
directly. Or a stomp client, etc, etc....


On Thu, Aug 29, 2013 at 2:21 PM, Wendell L. Hatcher <
wendellhatcher1074@gmail.com> wrote:

> Just take one message consume and print to a text file.  Is this possible
> in activemq?
>
>
> On Thu, Aug 29, 2013 at 4:45 PM, ceposta [via ActiveMQ] <
> ml-node+s2283324n4670933h76@n4.nabble.com> wrote:
>
> > not sure what you mean.
> > like you have a queue of 5 messages, and you want to "extract" one and
> > print that to a text file? or you just want to consume one message and
> > print that to a file? your best bet might be to look at apache camel.
> > doing
> > this would be dead simple.
> >
> >
> > On Thu, Aug 29, 2013 at 11:23 AM, Wendell L. Hatcher <
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=4670933&i=0>>
> > wrote:
> >
> > > Is it possible to copy a single message from a queue to a text file?
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://activemq.2283324.n4.nabble.com/Copy-Message-from-queue-to-a-text-file-tp4670925.html
> > > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> > >
> >
> >
> >
> > --
> > *Christian Posta*
> > http://www.christianposta.com/blog
> > twitter: @christianposta
> >  http://www.christianposta.com/blog
> >
> >
> > ------------------------------
> >  If you reply to this email, your message will be added to the discussion
> > below:
> >
> >
> http://activemq.2283324.n4.nabble.com/Copy-Message-from-queue-to-a-text-file-tp4670925p4670933.html
> >  To unsubscribe from Copy Message from queue to a text file., click here<
> http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4670925&code=d2VuZGVsbGhhdGNoZXIxMDc0QGdtYWlsLmNvbXw0NjcwOTI1fC02MzcxNDI1MjU=
> >
> > .
> > NAML<
> http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Copy-Message-from-queue-to-a-text-file-tp4670925p4670935.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Re: Copy Message from queue to a text file.

Posted by Timothy Bish <ta...@gmail.com>.
On 08/29/2013 05:21 PM, Wendell L. Hatcher wrote:
> Just take one message consume and print to a text file.  Is this possible
> in activemq?
ActiveMQ's job isn't to do things with text files.  You can consume a 
Message using the JMS API and then do whatever you want with the message 
contents.  As Christian said there are a number of Camel components that 
make doing things like this very simple.  Or just write the java code to 
write the Message to a file, up to you.


>
> On Thu, Aug 29, 2013 at 4:45 PM, ceposta [via ActiveMQ] <
> ml-node+s2283324n4670933h76@n4.nabble.com> wrote:
>
>> not sure what you mean.
>> like you have a queue of 5 messages, and you want to "extract" one and
>> print that to a text file? or you just want to consume one message and
>> print that to a file? your best bet might be to look at apache camel.
>> doing
>> this would be dead simple.
>>
>>
>> On Thu, Aug 29, 2013 at 11:23 AM, Wendell L. Hatcher <
>> [hidden email] <http://user/SendEmail.jtp?type=node&node=4670933&i=0>>
>> wrote:
>>
>>> Is it possible to copy a single message from a queue to a text file?
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>>
>> http://activemq.2283324.n4.nabble.com/Copy-Message-from-queue-to-a-text-file-tp4670925.html
>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>
>>
>>
>> --
>> *Christian Posta*
>> http://www.christianposta.com/blog
>> twitter: @christianposta
>>   http://www.christianposta.com/blog
>>
>>
>> ------------------------------
>>   If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://activemq.2283324.n4.nabble.com/Copy-Message-from-queue-to-a-text-file-tp4670925p4670933.html
>>   To unsubscribe from Copy Message from queue to a text file., click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4670925&code=d2VuZGVsbGhhdGNoZXIxMDc0QGdtYWlsLmNvbXw0NjcwOTI1fC02MzcxNDI1MjU=>
>> .
>> NAML<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Copy-Message-from-queue-to-a-text-file-tp4670925p4670935.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.


-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.fusesource.com | www.redhat.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/


Re: Copy Message from queue to a text file.

Posted by "Wendell L. Hatcher" <we...@gmail.com>.
Just take one message consume and print to a text file.  Is this possible
in activemq?


On Thu, Aug 29, 2013 at 4:45 PM, ceposta [via ActiveMQ] <
ml-node+s2283324n4670933h76@n4.nabble.com> wrote:

> not sure what you mean.
> like you have a queue of 5 messages, and you want to "extract" one and
> print that to a text file? or you just want to consume one message and
> print that to a file? your best bet might be to look at apache camel.
> doing
> this would be dead simple.
>
>
> On Thu, Aug 29, 2013 at 11:23 AM, Wendell L. Hatcher <
> [hidden email] <http://user/SendEmail.jtp?type=node&node=4670933&i=0>>
> wrote:
>
> > Is it possible to copy a single message from a queue to a text file?
> >
> >
> >
> > --
> > View this message in context:
> >
> http://activemq.2283324.n4.nabble.com/Copy-Message-from-queue-to-a-text-file-tp4670925.html
> > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >
>
>
>
> --
> *Christian Posta*
> http://www.christianposta.com/blog
> twitter: @christianposta
>  http://www.christianposta.com/blog
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://activemq.2283324.n4.nabble.com/Copy-Message-from-queue-to-a-text-file-tp4670925p4670933.html
>  To unsubscribe from Copy Message from queue to a text file., click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4670925&code=d2VuZGVsbGhhdGNoZXIxMDc0QGdtYWlsLmNvbXw0NjcwOTI1fC02MzcxNDI1MjU=>
> .
> NAML<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://activemq.2283324.n4.nabble.com/Copy-Message-from-queue-to-a-text-file-tp4670925p4670935.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Copy Message from queue to a text file.

Posted by Christian Posta <ch...@gmail.com>.
not sure what you mean.
like you have a queue of 5 messages, and you want to "extract" one and
print that to a text file? or you just want to consume one message and
print that to a file? your best bet might be to look at apache camel. doing
this would be dead simple.


On Thu, Aug 29, 2013 at 11:23 AM, Wendell L. Hatcher <
wendellhatcher1074@gmail.com> wrote:

> Is it possible to copy a single message from a queue to a text file?
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Copy-Message-from-queue-to-a-text-file-tp4670925.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta