Exemple #1
0
  public void testDefaultConfig() throws Exception {
    JmsConnector c = (JmsConnector) muleContext.getRegistry().lookupConnector("jmsConnector");
    assertNotNull(c);

    assertTrue(c.isEagerConsumer());
    JmsTopicResolver resolver = c.getTopicResolver();
    assertNotNull("Topic resolver must not be null.", resolver);
    assertTrue(
        "Wrong topic resolver configured on the connector.",
        resolver instanceof DefaultJmsTopicResolver);
  }
 private MessageConsumer createJMSMessageConsumer() throws MuleException, JMSException {
   InboundEndpoint endpoint = muleContext.getEndpointFactory().getInboundEndpoint("jms://out");
   JmsConnector jmsConnector =
       (JmsConnector) muleContext.getRegistry().lookupConnector("outPersistentConnector");
   JmsSupport jmsSupport = jmsConnector.getJmsSupport();
   MessageConsumer consumer =
       jmsSupport.createConsumer(
           jmsConnector.getSession(endpoint),
           jmsSupport.createDestination(jmsConnector.getSession(endpoint), endpoint),
           false,
           endpoint);
   return consumer;
 }