Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
416 views
in Technique[技术] by (71.8m points)

conflicting beans while using solace and jms

I am trying to read from multiple JMS queues of Solace and then publish message to weblogic JMS Queue. The problem is, as both of the source and target are JMS, I am getting a conflicting bean. The class for reading message from Solace Queues work good until the config class for weblogic JMS is introduced to the code. As soon as I introduce the Appconfig class the SolcaeListner.class starts listening to the queues on weblogic(which is not present) and hence errors out.

SolaceListner class:

@EnableJms @Component public class SolaceListner implements JmsListenerConfigurer {

@Value("${sol.InQueues}")
private String[] inQueues;

@Qualifier("default")
@Override
public void configureJmsListeners(JmsListenerEndpointRegistrar registrar) {
int i = 0;
for (String inQueue : inQueues) {
SimpleJmsListenerEndpoint endpoint = new SimpleJmsListenerEndpoint();
endpoint.setId("myJmsEndpoint-" + i++);
endpoint.setDestination(inQueue);
endpoint.setMessageListener(new MessageListener() {

            @Override
            public void onMessage(Message message) {
                System.out.println("Message received is : " + message);

                TextMessage tm = (TextMessage) message;
                try {
                    System.out.println("TextMessage= " + tm.getText());
                    JMSSender js = new JMSSender();
                    js.sender(tm.getText());
                } catch (JMSException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }

            }

        });

        registrar.registerEndpoint(endpoint);
        System.out.println("Registered the endpoint for queue: " + inQueue);

    }

}

}

question from:https://stackoverflow.com/questions/65936870/conflicting-beans-while-using-solace-and-jms

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...