You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Freeman Fang (JIRA)" <ji...@apache.org> on 2008/07/31 11:42:00 UTC

[jira] Resolved: (SM-1489) camelendpoint should transform StreamSource to DomSource which support to be consumed multiple times

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

Freeman Fang resolved SM-1489.
------------------------------

    Resolution: Fixed

commit fix
http://svn.apache.org/viewvc?rev=681311&view=rev for 3.2 branch
http://svn.apache.org/viewvc?rev=681313&view=rev for components project

> camelendpoint should transform StreamSource to DomSource which support to be consumed multiple times
> ----------------------------------------------------------------------------------------------------
>
>                 Key: SM-1489
>                 URL: https://issues.apache.org/activemq/browse/SM-1489
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-camel
>            Reporter: Freeman Fang
>            Assignee: Freeman Fang
>             Fix For: 3.2.3, 3.3
>
>


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


Re: [jira] Resolved: (SM-1489) camelendpoint should transform StreamSource to DomSource which support to be consumed multiple times

Posted by Gert Vanthienen <ge...@skynet.be>.
Guillaume,

I think we basically need to apply the patch for 
https://issues.apache.org/activemq/browse/CAMEL-179 to every Camel EIP 
that can send an exchange to multiple targets.  This was fixed for the 
multicast, but the same thing probably needs to be done for things like 
a deadletterchannel as well.

Gert

Guillaume Nodet wrote:
> Agreed, such a fix would be very damaging for overall performances.
> The question is why in our users's configuration make things goes
> wrong.  For example, all the EIP components take great care to make
> the message and its attachment re-readable (using a StringSource not a
> DOMSource btw), but only if the exchange is supposed to be sent to
> multiple targets (or if the exchange is persisted somehow).  This
> enable keeping the streams as long as possible and this is key to be
> able to handle very large messages.
>
> On Sat, Aug 2, 2008 at 1:22 PM, Gert Vanthienen
> <ge...@skynet.be> wrote:
>   
>> Freeman,
>>
>> I'm not sure that it is a good idea to do this transformation by default.
>>  If the Camel route is just routing the message to another endpoint,
>> converting it to a DOMSource will just consume an unnecessary amount of
>> memory and slow things down.  We should at least make this conversion to
>> DOMSource behavior configurable, but in the long run Camel should be made
>> aware of streaming Source implementations and automatically convert to a
>> DOMSource whenever necessary (similar to the streaming XML Source support in
>> ServicveMix).
>>
>> Wdyt?
>>
>> Gert
>>
>> Freeman Fang (JIRA) wrote:
>>     
>>>     [
>>> https://issues.apache.org/activemq/browse/SM-1489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
>>> ]
>>>
>>> Freeman Fang resolved SM-1489.
>>> ------------------------------
>>>
>>>    Resolution: Fixed
>>>
>>> commit fix
>>> http://svn.apache.org/viewvc?rev=681311&view=rev for 3.2 branch
>>> http://svn.apache.org/viewvc?rev=681313&view=rev for components project
>>>
>>>
>>>       
>>>> camelendpoint should transform StreamSource to DomSource which support to
>>>> be consumed multiple times
>>>>
>>>> ----------------------------------------------------------------------------------------------------
>>>>
>>>>                Key: SM-1489
>>>>                URL: https://issues.apache.org/activemq/browse/SM-1489
>>>>            Project: ServiceMix
>>>>         Issue Type: Bug
>>>>         Components: servicemix-camel
>>>>           Reporter: Freeman Fang
>>>>           Assignee: Freeman Fang
>>>>            Fix For: 3.2.3, 3.3
>>>>
>>>>
>>>>
>>>>         
>>>
>>>       
>>     
>
>
>
>   


Re: [jira] Resolved: (SM-1489) camelendpoint should transform StreamSource to DomSource which support to be consumed multiple times

Posted by Freeman Fang <fr...@gmail.com>.
Thanks Gert, I will revert the change then.
And the user should take care of the source re-readable issue, I think 
your suggestion to use streamCaching() from CAMEL dsl is a good way.

Freeman



Gert Vanthienen wrote:
> Freeman,
>
> That is probably there just for the purpose of being able to enable 
> DEBUG logging.  Without the conversion to DOMSource (or a StringSource 
> will do fine as well), the StreamSource would have become un-readable 
> after it had been output to the DEBUG log.  Since we really want to 
> show the message payload in the logging when DEBUG is enabled, we 
> should keep this conversion to a re-readable source type around imho.
>
> Gert
>
> Freeman Fang wrote:
>> Agreed we need revert this change since it will affect performance.
>>
>> And I also found in MessageExchangeImpl.java, we have code like
>>  Node node = st.toDOMNode(getMessage(msg).getContent());
>>  getMessage(msg).setContent(new DOMSource(node));
>>
>> this code is invoked when do MessageExchangeImpl.toString(), which 
>> means if we want to print out the MessageChangeImpl object (this is 
>> happen when we set LOG level to DEBUG), we lost the streamsource. I'm 
>> not sure this piece code is intended or we need fix it as well?
>>
>> Freeman
>>
>> Guillaume Nodet wrote:
>>> Agreed, such a fix would be very damaging for overall performances.
>>> The question is why in our users's configuration make things goes
>>> wrong.  For example, all the EIP components take great care to make
>>> the message and its attachment re-readable (using a StringSource not a
>>> DOMSource btw), but only if the exchange is supposed to be sent to
>>> multiple targets (or if the exchange is persisted somehow).  This
>>> enable keeping the streams as long as possible and this is key to be
>>> able to handle very large messages.
>>>
>>> On Sat, Aug 2, 2008 at 1:22 PM, Gert Vanthienen
>>> <ge...@skynet.be> wrote:
>>>  
>>>> Freeman,
>>>>
>>>> I'm not sure that it is a good idea to do this transformation by 
>>>> default.
>>>>  If the Camel route is just routing the message to another endpoint,
>>>> converting it to a DOMSource will just consume an unnecessary 
>>>> amount of
>>>> memory and slow things down.  We should at least make this 
>>>> conversion to
>>>> DOMSource behavior configurable, but in the long run Camel should 
>>>> be made
>>>> aware of streaming Source implementations and automatically convert 
>>>> to a
>>>> DOMSource whenever necessary (similar to the streaming XML Source 
>>>> support in
>>>> ServicveMix).
>>>>
>>>> Wdyt?
>>>>
>>>> Gert
>>>>
>>>> Freeman Fang (JIRA) wrote:
>>>>   
>>>>>     [
>>>>> https://issues.apache.org/activemq/browse/SM-1489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel 
>>>>>
>>>>> ]
>>>>>
>>>>> Freeman Fang resolved SM-1489.
>>>>> ------------------------------
>>>>>
>>>>>    Resolution: Fixed
>>>>>
>>>>> commit fix
>>>>> http://svn.apache.org/viewvc?rev=681311&view=rev for 3.2 branch
>>>>> http://svn.apache.org/viewvc?rev=681313&view=rev for components 
>>>>> project
>>>>>
>>>>>
>>>>>     
>>>>>> camelendpoint should transform StreamSource to DomSource which 
>>>>>> support to
>>>>>> be consumed multiple times
>>>>>>
>>>>>> ---------------------------------------------------------------------------------------------------- 
>>>>>>
>>>>>>
>>>>>>                Key: SM-1489
>>>>>>                URL: 
>>>>>> https://issues.apache.org/activemq/browse/SM-1489
>>>>>>            Project: ServiceMix
>>>>>>         Issue Type: Bug
>>>>>>         Components: servicemix-camel
>>>>>>           Reporter: Freeman Fang
>>>>>>           Assignee: Freeman Fang
>>>>>>            Fix For: 3.2.3, 3.3
>>>>>>
>>>>>>
>>>>>>
>>>>>>         
>>>>>
>>>>>       
>>>>     
>>>
>>>
>>>
>>>   
>>
>>
>
>


Re: [jira] Resolved: (SM-1489) camelendpoint should transform StreamSource to DomSource which support to be consumed multiple times

Posted by Gert Vanthienen <ge...@skynet.be>.
Freeman,

That is probably there just for the purpose of being able to enable 
DEBUG logging.  Without the conversion to DOMSource (or a StringSource 
will do fine as well), the StreamSource would have become un-readable 
after it had been output to the DEBUG log.  Since we really want to show 
the message payload in the logging when DEBUG is enabled, we should keep 
this conversion to a re-readable source type around imho.

Gert

Freeman Fang wrote:
> Agreed we need revert this change since it will affect performance.
>
> And I also found in MessageExchangeImpl.java, we have code like
>  Node node = st.toDOMNode(getMessage(msg).getContent());
>  getMessage(msg).setContent(new DOMSource(node));
>
> this code is invoked when do MessageExchangeImpl.toString(), which 
> means if we want to print out the MessageChangeImpl object (this is 
> happen when we set LOG level to DEBUG), we lost the streamsource. I'm 
> not sure this piece code is intended or we need fix it as well?
>
> Freeman
>
> Guillaume Nodet wrote:
>> Agreed, such a fix would be very damaging for overall performances.
>> The question is why in our users's configuration make things goes
>> wrong.  For example, all the EIP components take great care to make
>> the message and its attachment re-readable (using a StringSource not a
>> DOMSource btw), but only if the exchange is supposed to be sent to
>> multiple targets (or if the exchange is persisted somehow).  This
>> enable keeping the streams as long as possible and this is key to be
>> able to handle very large messages.
>>
>> On Sat, Aug 2, 2008 at 1:22 PM, Gert Vanthienen
>> <ge...@skynet.be> wrote:
>>  
>>> Freeman,
>>>
>>> I'm not sure that it is a good idea to do this transformation by 
>>> default.
>>>  If the Camel route is just routing the message to another endpoint,
>>> converting it to a DOMSource will just consume an unnecessary amount of
>>> memory and slow things down.  We should at least make this 
>>> conversion to
>>> DOMSource behavior configurable, but in the long run Camel should be 
>>> made
>>> aware of streaming Source implementations and automatically convert 
>>> to a
>>> DOMSource whenever necessary (similar to the streaming XML Source 
>>> support in
>>> ServicveMix).
>>>
>>> Wdyt?
>>>
>>> Gert
>>>
>>> Freeman Fang (JIRA) wrote:
>>>    
>>>>     [
>>>> https://issues.apache.org/activemq/browse/SM-1489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel 
>>>>
>>>> ]
>>>>
>>>> Freeman Fang resolved SM-1489.
>>>> ------------------------------
>>>>
>>>>    Resolution: Fixed
>>>>
>>>> commit fix
>>>> http://svn.apache.org/viewvc?rev=681311&view=rev for 3.2 branch
>>>> http://svn.apache.org/viewvc?rev=681313&view=rev for components 
>>>> project
>>>>
>>>>
>>>>      
>>>>> camelendpoint should transform StreamSource to DomSource which 
>>>>> support to
>>>>> be consumed multiple times
>>>>>
>>>>> ---------------------------------------------------------------------------------------------------- 
>>>>>
>>>>>
>>>>>                Key: SM-1489
>>>>>                URL: https://issues.apache.org/activemq/browse/SM-1489
>>>>>            Project: ServiceMix
>>>>>         Issue Type: Bug
>>>>>         Components: servicemix-camel
>>>>>           Reporter: Freeman Fang
>>>>>           Assignee: Freeman Fang
>>>>>            Fix For: 3.2.3, 3.3
>>>>>
>>>>>
>>>>>
>>>>>         
>>>>
>>>>       
>>>     
>>
>>
>>
>>   
>
>


Re: [jira] Resolved: (SM-1489) camelendpoint should transform StreamSource to DomSource which support to be consumed multiple times

Posted by Freeman Fang <fr...@gmail.com>.
Agreed we need revert this change since it will affect performance.

And I also found in MessageExchangeImpl.java, we have code like
  Node node = st.toDOMNode(getMessage(msg).getContent());
  getMessage(msg).setContent(new DOMSource(node));

this code is invoked when do MessageExchangeImpl.toString(), which means 
if we want to print out the MessageChangeImpl object (this is happen 
when we set LOG level to DEBUG), we lost the streamsource. I'm not sure 
this piece code is intended or we need fix it as well?

Freeman

Guillaume Nodet wrote:
> Agreed, such a fix would be very damaging for overall performances.
> The question is why in our users's configuration make things goes
> wrong.  For example, all the EIP components take great care to make
> the message and its attachment re-readable (using a StringSource not a
> DOMSource btw), but only if the exchange is supposed to be sent to
> multiple targets (or if the exchange is persisted somehow).  This
> enable keeping the streams as long as possible and this is key to be
> able to handle very large messages.
>
> On Sat, Aug 2, 2008 at 1:22 PM, Gert Vanthienen
> <ge...@skynet.be> wrote:
>   
>> Freeman,
>>
>> I'm not sure that it is a good idea to do this transformation by default.
>>  If the Camel route is just routing the message to another endpoint,
>> converting it to a DOMSource will just consume an unnecessary amount of
>> memory and slow things down.  We should at least make this conversion to
>> DOMSource behavior configurable, but in the long run Camel should be made
>> aware of streaming Source implementations and automatically convert to a
>> DOMSource whenever necessary (similar to the streaming XML Source support in
>> ServicveMix).
>>
>> Wdyt?
>>
>> Gert
>>
>> Freeman Fang (JIRA) wrote:
>>     
>>>     [
>>> https://issues.apache.org/activemq/browse/SM-1489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
>>> ]
>>>
>>> Freeman Fang resolved SM-1489.
>>> ------------------------------
>>>
>>>    Resolution: Fixed
>>>
>>> commit fix
>>> http://svn.apache.org/viewvc?rev=681311&view=rev for 3.2 branch
>>> http://svn.apache.org/viewvc?rev=681313&view=rev for components project
>>>
>>>
>>>       
>>>> camelendpoint should transform StreamSource to DomSource which support to
>>>> be consumed multiple times
>>>>
>>>> ----------------------------------------------------------------------------------------------------
>>>>
>>>>                Key: SM-1489
>>>>                URL: https://issues.apache.org/activemq/browse/SM-1489
>>>>            Project: ServiceMix
>>>>         Issue Type: Bug
>>>>         Components: servicemix-camel
>>>>           Reporter: Freeman Fang
>>>>           Assignee: Freeman Fang
>>>>            Fix For: 3.2.3, 3.3
>>>>
>>>>
>>>>
>>>>         
>>>
>>>       
>>     
>
>
>
>   


Re: [jira] Resolved: (SM-1489) camelendpoint should transform StreamSource to DomSource which support to be consumed multiple times

Posted by Guillaume Nodet <gn...@gmail.com>.
Agreed, such a fix would be very damaging for overall performances.
The question is why in our users's configuration make things goes
wrong.  For example, all the EIP components take great care to make
the message and its attachment re-readable (using a StringSource not a
DOMSource btw), but only if the exchange is supposed to be sent to
multiple targets (or if the exchange is persisted somehow).  This
enable keeping the streams as long as possible and this is key to be
able to handle very large messages.

On Sat, Aug 2, 2008 at 1:22 PM, Gert Vanthienen
<ge...@skynet.be> wrote:
> Freeman,
>
> I'm not sure that it is a good idea to do this transformation by default.
>  If the Camel route is just routing the message to another endpoint,
> converting it to a DOMSource will just consume an unnecessary amount of
> memory and slow things down.  We should at least make this conversion to
> DOMSource behavior configurable, but in the long run Camel should be made
> aware of streaming Source implementations and automatically convert to a
> DOMSource whenever necessary (similar to the streaming XML Source support in
> ServicveMix).
>
> Wdyt?
>
> Gert
>
> Freeman Fang (JIRA) wrote:
>>
>>     [
>> https://issues.apache.org/activemq/browse/SM-1489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
>> ]
>>
>> Freeman Fang resolved SM-1489.
>> ------------------------------
>>
>>    Resolution: Fixed
>>
>> commit fix
>> http://svn.apache.org/viewvc?rev=681311&view=rev for 3.2 branch
>> http://svn.apache.org/viewvc?rev=681313&view=rev for components project
>>
>>
>>>
>>> camelendpoint should transform StreamSource to DomSource which support to
>>> be consumed multiple times
>>>
>>> ----------------------------------------------------------------------------------------------------
>>>
>>>                Key: SM-1489
>>>                URL: https://issues.apache.org/activemq/browse/SM-1489
>>>            Project: ServiceMix
>>>         Issue Type: Bug
>>>         Components: servicemix-camel
>>>           Reporter: Freeman Fang
>>>           Assignee: Freeman Fang
>>>            Fix For: 3.2.3, 3.3
>>>
>>>
>>>
>>
>>
>>
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/

Re: [jira] Resolved: (SM-1489) camelendpoint should transform StreamSource to DomSource which support to be consumed multiple times

Posted by Gert Vanthienen <ge...@skynet.be>.
Freeman,

I'm not sure that it is a good idea to do this transformation by 
default.  If the Camel route is just routing the message to another 
endpoint, converting it to a DOMSource will just consume an unnecessary 
amount of memory and slow things down.  We should at least make this 
conversion to DOMSource behavior configurable, but in the long run Camel 
should be made aware of streaming Source implementations and 
automatically convert to a DOMSource whenever necessary (similar to the 
streaming XML Source support in ServicveMix).

Wdyt?

Gert

Freeman Fang (JIRA) wrote:
>      [ https://issues.apache.org/activemq/browse/SM-1489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Freeman Fang resolved SM-1489.
> ------------------------------
>
>     Resolution: Fixed
>
> commit fix
> http://svn.apache.org/viewvc?rev=681311&view=rev for 3.2 branch
> http://svn.apache.org/viewvc?rev=681313&view=rev for components project
>
>   
>> camelendpoint should transform StreamSource to DomSource which support to be consumed multiple times
>> ----------------------------------------------------------------------------------------------------
>>
>>                 Key: SM-1489
>>                 URL: https://issues.apache.org/activemq/browse/SM-1489
>>             Project: ServiceMix
>>          Issue Type: Bug
>>          Components: servicemix-camel
>>            Reporter: Freeman Fang
>>            Assignee: Freeman Fang
>>             Fix For: 3.2.3, 3.3
>>
>>
>>     
>
>
>