Certainly, would have made more sense.<br><br>Currently, in JMS you define interfaces like this to map routes - equivalent to a CDI Event Bridge - to JMS Destinations (Queues and Topics):<br><br>public interfaces MyMappingInterface{<br>
@Inbound<br>public void handleStrings(@Observes String s, @JmsDestination(&quot;jms/MyTopic&quot;) Topic topic);<br>@Outbound<br>public void handleLongs(@Observes Long l, @JmsDestination(&quot;jms/MyQueue&quot;) Queue queue);<br>
}<br><br>This says that a listener will be created for the topic jms/MyTopic and any TextMessage or ObjectMessage with payload type String.class will be forwarded to an observer method defined like this:<br><br>public void observeStrings(@Observes @Inbound String s) {<br>
<br>}<br><br>Likewise, the second line in the interface says that Events of type Long that are fired with the @Outbound qualifier will be sent to a Queue jms/MyQueue,<br><br>@Inject @Outbound Event&lt;Long&gt; longEvent;<br>
<br>Results in Seam JMS dynamically generating an observer method on deployment that handles and forwards the long fired.<br><br>What I&#39;m proposing is that we do away with (not literally, I would keep it in) the interface.  Instead, we look at the events injected and the observers defined.  The same observer method would be defined like this:<br>
<br>@JMS(&quot;jms/MyTopic&quot;)<br>public void observeStrings(@Observes @Inbound String s) {<br>}<br><br>And the injected event:<br><br>@Inject @JMS(&quot;jms/MyQueue&quot;) @Outbound Event&lt;Long&gt; longEvent;<br><br>
Does that make sense?<br><br>John<br><br><br><div class="gmail_quote">On Thu, Jun 2, 2011 at 7:49 AM, Pete Muir <span dir="ltr">&lt;<a href="mailto:pmuir@redhat.com">pmuir@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5"><br>
On 2 Jun 2011, at 02:29, John D. Ament wrote:<br>
<br>
&gt; Something I&#39;ve been thinking about for a while now is the mapping APIs used by Seam JMS.  Currently, you write an interface to define routes used by JMS events.  This requires a bit of extra code that I&#39;m not a big fan of.  What I was thinking was put an extra annotation on either the injection point of the event or the observer method.  The idea is that the annotation would include all of the destination configuration necessary.  For example:<br>

&gt;<br>
&gt; @Inject @JMS(&quot;jms/QueueOne&quot;,&quot;jms/QueueTwo&quot;,&quot;jms/QueueThree&quot;) Event&lt;MyType&gt; myTypeEvent;<br>
&gt;<br>
&gt; @JMS(&quot;jms/MyTopic&quot;)<br>
&gt; public void handleMessages(@Observes Long longsInTopic) {<br>
&gt;<br>
&gt; ....<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; The issues I see, since essentially I have to create an extra observer/firing pair to support each of these, is how to determine the observed type in the event.  In general, any thoughts? Is it possible to determine the event&#39;s type in this case? If so, does the approach make sense?<br>

<br>
</div></div>Can you show what this replaces? I.e. before and after?</blockquote></div><br>