You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bu...@apache.org on 2013/04/05 22:18:44 UTC

svn commit: r857437 - in /websites/production/camel/content: cache/main.pageCache guava-eventbus.html

Author: buildbot
Date: Fri Apr  5 20:18:44 2013
New Revision: 857437

Log:
Production update by buildbot for camel

Modified:
    websites/production/camel/content/cache/main.pageCache
    websites/production/camel/content/guava-eventbus.html

Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/camel/content/guava-eventbus.html
==============================================================================
--- websites/production/camel/content/guava-eventbus.html (original)
+++ websites/production/camel/content/guava-eventbus.html Fri Apr  5 20:18:44 2013
@@ -184,6 +184,34 @@ eventBus.register(<span class="code-keyw
 <pre class="code-java">
 from(<span class="code-quote">"guava-eventbus:busName?listenerInterface=com.example.CustomListener"</span>).to(<span class="code-quote">"seda:queue"</span>);
 </pre>
+</div></div>
+
+<h3><a shape="rect" name="GuavaEventBus-Consumingmultipletypeofevents"></a>Consuming multiple type of events</h3>
+
+<p>In order to define multiple type of events to be consumed by Guava EventBus consumer use <tt>listenerInterface</tt> endpoint option, as listener interface could provide multiple methods marked with the <tt>@Subscribe</tt> annotation.</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+<span class="code-keyword">package</span> com.example;
+
+<span class="code-keyword">public</span> <span class="code-keyword">interface</span> MultipleEventsListener {
+
+  @Subscribe
+  void someEventReceived(SomeEvent event);
+
+  @Subscribe
+  void anotherEventReceived(AnotherEvent event);
+
+}
+</pre>
+</div></div>
+
+<p>The listener presented above could be used in the endpoint definition as follows.</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">
+from(<span class="code-quote">"guava-eventbus:busName?listenerInterface=com.example.MultipleEventsListener"</span>).to(<span class="code-quote">"seda:queue"</span>);
+</pre>
 </div></div></div>
         </td>
         <td valign="top">