[jira] Created: (CAMEL-782) Tracer incorrectly treats messages with InputStream as body

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

[jira] Created: (CAMEL-782) Tracer incorrectly treats messages with InputStream as body

JIRA jira@apache.org
Tracer incorrectly treats messages with InputStream as body
-----------------------------------------------------------

                 Key: CAMEL-782
                 URL: https://issues.apache.org/activemq/browse/CAMEL-782
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-core
            Reporter: Genadii Ganebnyi


Suppose we have the following flow:

 from("activemq:vasea")
  .to("cxf:bean:serviceEndpoint?dataFormat=MESSAGE")
    .unmarshal().string()
  .to("activemq:petea");

In this flow cxf:bean:serviceEndpoint returns ByteArrayInputStream as body. Under normal conditions everything works fine: WS output gets to the queue.
But if we add:
getContext().addInterceptStrategy(new Tracer());
Queue starts receiving empty messages. After digging in the code I found out that tracer reads input stream in order to display body, but not resets it. Thus when message reaches unmarshaller, nothing could be read from the stream.


--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-782) Tracer incorrectly treats messages with InputStream as body

JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44746#action_44746 ]

Claus Ibsen commented on CAMEL-782:
-----------------------------------

Ah good catch. The logger could have the same problem as well.

I remember there is something with streamcache that might can help out here. I don't have the time to dig into it yet.

A workaround is to disable logging of the body in the tracer. There are options for this in the formatter:
http://activemq.apache.org/camel/tracer.html

> Tracer incorrectly treats messages with InputStream as body
> -----------------------------------------------------------
>
>                 Key: CAMEL-782
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-782
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>            Reporter: Genadii Ganebnyi
>
> Suppose we have the following flow:
>  from("activemq:vasea")
>   .to("cxf:bean:serviceEndpoint?dataFormat=MESSAGE")
>     .unmarshal().string()
>   .to("activemq:petea");
> In this flow cxf:bean:serviceEndpoint returns ByteArrayInputStream as body. Under normal conditions everything works fine: WS output gets to the queue.
> But if we add:
> getContext().addInterceptStrategy(new Tracer());
> Queue starts receiving empty messages. After digging in the code I found out that tracer reads input stream in order to display body, but not resets it. Thus when message reaches unmarshaller, nothing could be read from the stream.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (CAMEL-782) Tracer incorrectly treats messages with InputStream as body

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-782:
------------------------------

        Fix Version/s: 1.5.0
    Affects Version/s: 1.4.0

> Tracer incorrectly treats messages with InputStream as body
> -----------------------------------------------------------
>
>                 Key: CAMEL-782
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-782
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Genadii Ganebnyi
>             Fix For: 1.5.0
>
>
> Suppose we have the following flow:
>  from("activemq:vasea")
>   .to("cxf:bean:serviceEndpoint?dataFormat=MESSAGE")
>     .unmarshal().string()
>   .to("activemq:petea");
> In this flow cxf:bean:serviceEndpoint returns ByteArrayInputStream as body. Under normal conditions everything works fine: WS output gets to the queue.
> But if we add:
> getContext().addInterceptStrategy(new Tracer());
> Queue starts receiving empty messages. After digging in the code I found out that tracer reads input stream in order to display body, but not resets it. Thus when message reaches unmarshaller, nothing could be read from the stream.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Assigned: (CAMEL-782) Tracer incorrectly treats messages with InputStream as body

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang reassigned CAMEL-782:
----------------------------------

    Assignee: Willem Jiang

> Tracer incorrectly treats messages with InputStream as body
> -----------------------------------------------------------
>
>                 Key: CAMEL-782
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-782
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Genadii Ganebnyi
>            Assignee: Willem Jiang
>             Fix For: 1.5.0
>
>
> Suppose we have the following flow:
>  from("activemq:vasea")
>   .to("cxf:bean:serviceEndpoint?dataFormat=MESSAGE")
>     .unmarshal().string()
>   .to("activemq:petea");
> In this flow cxf:bean:serviceEndpoint returns ByteArrayInputStream as body. Under normal conditions everything works fine: WS output gets to the queue.
> But if we add:
> getContext().addInterceptStrategy(new Tracer());
> Queue starts receiving empty messages. After digging in the code I found out that tracer reads input stream in order to display body, but not resets it. Thus when message reaches unmarshaller, nothing could be read from the stream.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (CAMEL-782) Tracer incorrectly treats messages with InputStream as body

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang resolved CAMEL-782.
--------------------------------

    Resolution: Fixed

Hi Genadii

 I just did a quick fix for it.  
 Please check out the latest Camel 1.5 snapshot and let me know you feed back :)

Willem

> Tracer incorrectly treats messages with InputStream as body
> -----------------------------------------------------------
>
>                 Key: CAMEL-782
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-782
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Genadii Ganebnyi
>            Assignee: Willem Jiang
>             Fix For: 1.5.0
>
>
> Suppose we have the following flow:
>  from("activemq:vasea")
>   .to("cxf:bean:serviceEndpoint?dataFormat=MESSAGE")
>     .unmarshal().string()
>   .to("activemq:petea");
> In this flow cxf:bean:serviceEndpoint returns ByteArrayInputStream as body. Under normal conditions everything works fine: WS output gets to the queue.
> But if we add:
> getContext().addInterceptStrategy(new Tracer());
> Queue starts receiving empty messages. After digging in the code I found out that tracer reads input stream in order to display body, but not resets it. Thus when message reaches unmarshaller, nothing could be read from the stream.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.