You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Simple Appointment <sa...@hotmail.com> on 2016/10/30 12:43:41 UTC

Logging received messages to stream:out

I am new to camel and would like to use it as our integration component. 
I was trying to log messages received from a jms queue to the console 
and it seems that the messages accumulates. Lets say I have messages
one,two,three,four in my queue.

    def configure(): Unit =  {
      from("activemq:TEST.FOO")
      .log(" stream:out")
    }

What I get is:

one,
one,two
one,two,three
one,two,three,four

I was expecting
one
two
three
four

Am I missing something?

Re: Logging received messages to stream:out

Posted by Ioannis Mavroukakis <im...@gmail.com>.
Check your queue. You might find that the messages are not consumed and thus stay on the queue. 

> On 30 Oct 2016, at 12:43, Simple Appointment <sa...@hotmail.com> wrote:
> 
> I am new to camel and would like to use it as our integration component. 
> I was trying to log messages received from a jms queue to the console 
> and it seems that the messages accumulates. Lets say I have messages
> one,two,three,four in my queue.
> 
>    def configure(): Unit =  {
>      from("activemq:TEST.FOO")
>      .log(" stream:out")
>    }
> 
> What I get is:
> 
> one,
> one,two
> one,two,three
> one,two,three,four
> 
> I was expecting
> one
> two
> three
> four
> 
> Am I missing something?

Re: Logging received messages to stream:out

Posted by Simple Appointment <sa...@hotmail.com>.
I am not using the scala dsl. It is basically java in scala.

My fault. I meant to say:

    def configure(): Unit =  {
      from("activemq:TEST.FOO")
      .to("stream:out")
    }

But I found my mistake; my producer was sending buffered messages and 
camel was doing the right thing.



On 30.10.2016 13:54, souciance wrote:
> I am not familiar with the scala dsl but if you just want to log the
> message you can write:
>
> .log(LoggingLevel.INFO, "mylogger", "${body}")
>
> If you want to send to stream out then can do:
> .to("stream:out")
> You will need to add the dependency for camel-stream for this work.
>
> On Sun, Oct 30, 2016 at 1:44 PM, Simple Appointment [via Camel] <
> ml-node+s465427n5789478h81@n5.nabble.com> wrote:
>
>> I am new to camel and would like to use it as our integration component.
>> I was trying to log messages received from a jms queue to the console
>> and it seems that the messages accumulates. Lets say I have messages
>> one,two,three,four in my queue.
>>
>>      def configure(): Unit =  {
>>        from("activemq:TEST.FOO")
>>        .log(" stream:out")
>>      }
>>
>> What I get is:
>>
>> one,
>> one,two
>> one,two,three
>> one,two,three,four
>>
>> I was expecting
>> one
>> two
>> three
>> four
>>
>> Am I missing something?
>>
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>> http://camel.465427.n5.nabble.com/Logging-received-messages-
>> to-stream-out-tp5789478.html
>> To start a new topic under Camel - Users, email
>> ml-node+s465427n465428h31@n5.nabble.com
>> To unsubscribe from Camel - Users, click here
>> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
>> .
>> NAML
>> <http://camel.465427.n5.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://camel.465427.n5.nabble.com/Logging-received-messages-to-stream-out-tp5789478p5789480.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Logging received messages to stream:out

Posted by souciance <so...@gmail.com>.
I am not familiar with the scala dsl but if you just want to log the
message you can write:

.log(LoggingLevel.INFO, "mylogger", "${body}")

If you want to send to stream out then can do:
.to("stream:out")
You will need to add the dependency for camel-stream for this work.

On Sun, Oct 30, 2016 at 1:44 PM, Simple Appointment [via Camel] <
ml-node+s465427n5789478h81@n5.nabble.com> wrote:

> I am new to camel and would like to use it as our integration component.
> I was trying to log messages received from a jms queue to the console
> and it seems that the messages accumulates. Lets say I have messages
> one,two,three,four in my queue.
>
>     def configure(): Unit =  {
>       from("activemq:TEST.FOO")
>       .log(" stream:out")
>     }
>
> What I get is:
>
> one,
> one,two
> one,two,three
> one,two,three,four
>
> I was expecting
> one
> two
> three
> four
>
> Am I missing something?
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Logging-received-messages-
> to-stream-out-tp5789478.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.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://camel.465427.n5.nabble.com/Logging-received-messages-to-stream-out-tp5789478p5789480.html
Sent from the Camel - Users mailing list archive at Nabble.com.