I have created a bean and want to publish 2 endpoints.... Both endpoints
would be handled by the same bean but a different operation.

public class MyBean implements MessageExchangeListener {

    @Resource
    private DeliveryChannel channel;
    
    private static final Log log = LogFactory.getLog(MyBean.class);
      
    private MessageExchange myExchangeMethod;

    
    public void onMessageExchange(MessageExchange exchange) throws
MessagingException {
        NormalizedMessage message = exchange.getMessage("in");
                System.out.println("Received exchange: " + 
getMessageContent(message));
        
                String[] userDetails = getMessageContent(message).split(" ");
                //User newUser = new User(userDetails[0], userDetails[1]);
                //Store.addUser(newUser);
                
        exchange.setStatus(ExchangeStatus.DONE);
        channel.send(exchange);
    }
    
    @Operation(name = "bar")
    public void myExchangeMethod(MessageExchange messageExchange) {
        this.myExchangeMethod = messageExchange;
        System.out.println("Received exchange: " +
getMessageContent(messageExchange.getMessage("in")));
     
        log.info("myExchangeMethod() received exchange: " + messageExchange);
    }
}

Then I have tried publishing the 2 enbpoints using xbean.xml as follows:
  <bean:endpoint service="seminar:store" endpoint="endpoint" 
bean="#myBean"/>
  <bean:endpoint service="seminar:store" endpoint="foo" operation="bar"
bean="#myBean"/>

  <bean id="myBean" class="mv40000.seminar.servicemix.MyBean"/>

but this does not work... How could I tell that endpoint foo needs to call
"bar" operation?

Thanks in advance,
m.v.
-- 
View this message in context: 
http://www.nabble.com/bean-enpoint-operation-annotation-newbie-question-tp19562226p19562226.html
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.

Reply via email to