Select Your Language

Infrastructure and Management

Cloud Computing

Storage

Runtimes

Integration and Automation

  • Comments
  • Switchyard Reference with Multiple JMS Bindings: How to Endpoint it

    Posted on

    Howdy!

    Using ye ol venerable and most excellent switchyard-quickstart-rules-camel-cdr and setting up a Routing Drools rule to access a reference service of type JMS which has 2+ defined binding gateways:

    
          
          
            MCI_CTL
            #MAPSTS1ConnectionFactory
          
          
            SMM_STAT
            #MAPSTS1ConnectionFactory
          
        
    

    When I compile and deploy, I see:

    17:12:05,668 INFO  [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-3) Route: direct:{urn:org.switchyard.quickstarts.rules.camel.cbr:1.0}RoutingService/MAPSOutboundBindingService started and consuming from: Endpoint[direct://%7Burn:org.switchyard.quickstarts.rules.camel.cbr:1.0%7DRoutingService/MAPSOutboundBindingService]
    
    

    And when I invoke the rule, which is defined as:

    rule "MAPS Wrapper Bindings Outbound"
        when
            $facadeMessage : IFacadeMessage(msgID matches "001XXX-.*")
        then
            $facadeMessage.setDestination("switchyard://MAPSOutboundService@SMM_STAT");
    end
    

    The result is:

    Caused by: java.lang.NullPointerException: SWITCHYARD033900: No ServiceReference was found for uri [switchyard://MAPSOutboundBindingService@SMM_STAT]
            at org.switchyard.component.camel.SwitchYardProducer.lookupServiceReference(SwitchYardProducer.java:178) [switchyard-component-camel-switchyard-1.1.1-p5-redhat-1.jar:1.1.1-p5-redhat-1]
    

    So I have to deduce then that how I am referencing the swithcyard endpoint from Drools is incorrect, so I try other forms:

    $facadeMessage.setDestination("switchyard://MAPSOutboundService/SMM_STAT");
    $facadeMessage.setDestination("switchyard://MAPSOutboundService.SMM_STAT");
    $facadeMessage.setDestination("switchyard://MAPSOutboundService/@SMM_STAT");
    $facadeMessage.setDestination("switchyard://MAPSOutboundService:SMM_STAT");
    

    Actually what I found that that when using switchyard://MAPSOutboundService/SMM_STAT, I would get a JMS publish to MCI_CTL topic, which is listed FIRST in the list of Gateway bindings.

    So I said to myself, "Self... what if these other bindings are not registered". So I use the admin web gui, and look at switchyard subsystem, open up reference MAPSOutboundService, then details and PRESTO! There are my defined Gateways! So they are indeed in the system and registered.

    Even used a ModelControllerClient implementation to pull the switchyard subsystem directly, here is what I got:

    {"name" => "{urn:org.switchyard.quickstarts.rules.camel.cbr:1.0}MAPSOutboundBindingService","application" => "{urn:org.switchyard.quickstarts.rules.camel.cbr:1.0}wst-facade","interface" => "org.switchyard.quickstarts.rules.camel.cbr.common.service.ProcessMessageService","promotedReference" => "RoutingService/MAPSOutboundBindingService","gateways" => [{"name" => "TS1_MAPS_SMM_STAT","type" => "jms","configuration" => "
        
        
        SMM_STAT
        #MAPSTS1ConnectionFactory
    ","state" => "STARTED"},{"name" => "MCI_CTL","type" => "jms","configuration" => "
        
        
        MCI_CTL
        #MAPSTS1ConnectionFactory
    ","state" => "STARTED"},{"name" => "SMM_STAT","type" => "jms","configuration" => "
        
        
        VLF_CTL
        #MAPSTS1ConnectionFactory
    ","state" => "STARTED"}}
    

    With all that said... it seems like this is a proper use of assigning multiple gateway bindings to a reference service. But I have no clue how to access the Bindings?!?!? Any ideas?!

    by

    points

    Responses

    Red Hat LinkedIn YouTube Facebook X, formerly Twitter

    Quick Links

    Help

    Site Info

    Related Sites

    © 2026 Red Hat