Sueleyman Vurucu created SEAMJMS-68:
---------------------------------------

             Summary: Flexible Route definition
                 Key: SEAMJMS-68
                 URL: https://issues.jboss.org/browse/SEAMJMS-68
             Project: Seam JMS
          Issue Type: Feature Request
          Components: Event Bridging
    Affects Versions: 3.1.0.Final
            Reporter: Sueleyman Vurucu


Hi guys,
first of all thanks for this work. 

I define a Route like this,

public class RouteRepository {

  @Routing (RouteType.INGRESS)
  public Route routeIn(RouteManager routeManager){
    return 
routeManager.createInboundRoute(TelegramEvent.class).addQualifiers(new 
AnnotationLiteral<QIncomming>() {
    }).connectTo(Topic.class, 
RouteHelper.getTopic(JMSRepositorsy.DummyTopicRCV));
  }
  @Routing (RouteType.INGRESS)
  public Route routeIn100(RouteManager routeManager){
    return 
routeManager.createInboundRoute(TelegramEvent100.class).addQualifiers(new 
AnnotationLiteral<QIncomming100>() {
    }).connectTo(Topic.class, 
RouteHelper.getTopic(JMSRepositorsy.DummyTopicRCV));
  }
  @Routing (RouteType.INGRESS)
  public Route routeIn1001(RouteManager routeManager){
    return 
routeManager.createInboundRoute(TelegramEvent1001.class).addQualifiers(new 
AnnotationLiteral<QIncomming1001>() {
    }).connectTo(Topic.class, 
RouteHelper.getTopic(JMSRepositorsy.DummyTopicRCV));
  }
  
  @Routing (RouteType.EGRESS)
  public Route routeOut( RouteManager routeManager){
    return 
routeManager.createOutboundRoute(TelegramEvent.class).addQualifiers(new 
AnnotationLiteral<QOutgoing>() {
    }).connectTo(Topic.class, 
RouteHelper.getTopic(JMSRepositorsy.DummyTopicSND));
  }

And this is my Obeserver side.

public void handleTelegramEvent(@Observes @QIncomming TelegramEvent event){
   log.info("RECEIVE TelegramEvent "+event);
 }
 public void handleTelegramEvent(@Observes @QIncomming100 TelegramEvent100 
event){
   log.info("RECEIVE TelegramEvent100 "+event);
 }
 
 public void handleTelegramEvent(@Observes @QIncomming1001 TelegramEvent1001 
event){
   log.info("RECEIVE TelegramEvent1001 "+event);
 }

The TelegramEvents are in inheritence hierachy like this:
TelegramEvent <-- TelegramEvent100 <-- TelegramEvent1001

So if I send a Message to JMS for example TelegramEvent1001 then all my 
observer methods are triggered. 

The reason for that is the implementation of IngressMessageListener I think. It 
fires events for all qualifiers for the superclass. 

So I need a possibility to change the behavior of IngressMessageListener. 
Unfortunally this is not an injected field. This is also hardcoded. 

Let's assume that the IngressMessageListener is a CDI bean and injected into 
RouteBuilderImpl. Then I can cahnge this listener by adding my listener as an 
alternative, right ??




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
seam-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/seam-issues

Reply via email to