<html>
<head>
<base href="https://cwiki.apache.org/confluence">
<link rel="stylesheet" href="/confluence/s/en/2176/1/1/_/styles/combined.css?spaceKey=CAMEL&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/display/CAMEL/Browse">Browse</a></h2>
<h4>Page <b>edited</b> by <a href="https://cwiki.apache.org/confluence/display/~ceposta">Christian
Posta</a>
</h4>
<br/>
<h4>Changes (2)</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" > <br>{code} <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">browse:someName
<br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">browse:someName[?options]
<br></td></tr>
<tr><td class="diff-unchanged" >{code} <br> <br></td></tr>
<tr><td class="diff-snipped" >...<br></td></tr>
</table>
</div> <h4>Full Content</h4>
<div class="notificationGreySide">
<h2><a name="Browse-BrowseComponent"></a>Browse Component</h2>
<p>The Browse component provides a simple <a href="/confluence/display/CAMEL/BrowsableEndpoint"
title="BrowsableEndpoint">BrowsableEndpoint</a> which can be useful for testing,
visualisation tools or debugging. The exchanges sent to the endpoint are all available to
be browsed.</p>
<h3><a name="Browse-URIformat"></a>URI format</h3>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
browse:someName[?options]
</pre>
</div></div>
<p>Where <b>someName</b> can be any string to uniquely identify the endpoint.</p>
<h3><a name="Browse-Sample"></a>Sample</h3>
<p>In the route below, we insert a <tt>browse:</tt> component to be able
to browse the Exchanges that are passing through:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
from("activemq:order.in").to("browse:orderReceived").to("bean:processOrder");
</pre>
</div></div>
<p>We can now inspect the received exchanges from within the Java code:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">
private CamelContext context;
public void inspectRecievedOrders() {
BrowsableEndpoint browse = context.getEndpoint("browse:orderReceived", BrowsableEndpoint.class);
List<Exchange> exchanges = browse.getExchanges();
...
// then we can inspect the list of received exchanges from Java
for (Exchange exchange : exchanges) {
String payload = exchange.getIn().getBody();
...
}
}
</pre>
</div></div>
<h3><a name="Browse-SeeAlso"></a>See Also</h3>
<ul>
<li><a href="/confluence/display/CAMEL/Configuring+Camel" title="Configuring Camel">Configuring
Camel</a></li>
<li><a href="/confluence/display/CAMEL/Component" title="Component">Component</a></li>
<li><a href="/confluence/display/CAMEL/Endpoint" title="Endpoint">Endpoint</a></li>
<li><a href="/confluence/display/CAMEL/Getting+Started" title="Getting Started">Getting
Started</a></li>
</ul>
</div>
<div id="commentsSection" class="wiki-content pageSection">
<div style="float: right;" class="grey">
<a href="https://cwiki.apache.org/confluence/users/removespacenotification.action?spaceKey=CAMEL">Stop
watching space</a>
<span style="padding: 0px 5px;">|</span>
<a href="https://cwiki.apache.org/confluence/users/editmyemailsettings.action">Change
email notification preferences</a>
</div>
<a href="https://cwiki.apache.org/confluence/display/CAMEL/Browse">View Online</a>
|
<a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=104024&revisedVersion=4&originalVersion=3">View
Changes</a>
|
<a href="https://cwiki.apache.org/confluence/display/CAMEL/Browse?showComments=true&showCommentArea=true#addcomment">Add
Comment</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
|