camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > How do I set the MEP when interacting with JBI?
Date Wed, 07 Mar 2012 15:07:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=97303">How
do I set the MEP when interacting with JBI?</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~dkulp">Daniel
Kulp</a>
    </h4>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >If the timer endpoint that starts
the route sends a Camel exchange with an in-only MEP, the MEP for interacting with JBI will
also be InOnly.  Now imagine that the target JBI endpoint is in fact a [servicemix-saxon xslt
<span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">endpoint|SM:servicemix-saxon],</span>
<span class="diff-added-words"style="background-color: #dfd;">endpoint|http://servicemix.apache.org/servicemix-saxon.html],</span>
that really expects an InOut MEP.  This would break the Camel route above. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>h4. Solution <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h4><a name="HowdoIsettheMEPwheninteractingwithJBI%3F-Problem"></a>Problem</h4>

<p>If you are using the Camel <a href="/confluence/display/CAMEL/JBI" title="JBI">JBI</a>
integration to send a MessageExchange to another JBI component from within your Camel route,
Camel uses the MEP of the underlying Camel Exchange to determine the MEP of the JBI MessageExchange.
 An example:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
from(<span class="code-quote">""timer:<span class="code-comment">//foo"</span>).to(<span
class="code-quote">"jbi:endpoint:urn:translator:endpoint"</span>).to(<span class="code-quote">"log:test"</span>);
                   //THIS WON'T WORK...</span>
</pre>
</div></div>

<p>If the timer endpoint that starts the route sends a Camel exchange with an in-only
MEP, the MEP for interacting with JBI will also be InOnly.  Now imagine that the target JBI
endpoint is in fact a <a href="http://servicemix.apache.org/servicemix-saxon.html" class="external-link"
rel="nofollow">servicemix-saxon xslt endpoint</a>, that really expects an InOut MEP.
 This would break the Camel route above. </p>

<h4><a name="HowdoIsettheMEPwheninteractingwithJBI%3F-Solution"></a>Solution</h4>

<p>For this se case, you can override the MEP used from the Camel route like this, making
sure that a JBI InOut MessageExchange is being used to interact with the <tt>"urn:translation:endpoint"</tt>
endpoint.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
from(<span class="code-quote">""timer:<span class="code-comment">//foo"</span>).to(<span
class="code-quote">"jbi:endpoint:urn:translator:endpoint?mep=in-out"</span>).to(<span
class="code-quote">"log:test"</span>);        //...BUT THIS WILL</span>
</pre>
</div></div>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=97303">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=97303&revisedVersion=2&originalVersion=1">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=97303&showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message