Logging received messages to stream:out

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Logging received messages to stream:out

sa_james
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?
Guile Newbie
Reply | Threaded
Open this post in threaded view
|

Re: Logging received messages to stream:out

Ioannis Mavroukakis
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 <[hidden email]> 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?
Reply | Threaded
Open this post in threaded view
|

Re: Logging received messages to stream:out

souciance
In reply to this post by sa_james
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] <[hidden email]> 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 [hidden email]
To unsubscribe from Camel - Users, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Logging received messages to stream:out

sa_james
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] <
> [hidden email]> 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
>> [hidden email]
>> To unsubscribe from Camel - Users, click here
>> <
>> .
>> 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.

Guile Newbie