activeMQ를 사용하여 JMS 애플리케이션을 설계해야합니다. 게시자와 구독자 모두 역할을해야하는 2 명의 고객이 있습니다. 예 : 첫 번째 클라이언트가 smth를 그리면. 두 번째 클라이언트는 자신의 GUI에서이를 볼 수 있어야하며 그 반대도 마찬가지입니다.JMS (주제) - 클라이언트를 프로듀서 및 컨슈머 모두로 구현하는 방법
서버에 "바인딩"하는 방법과 activeMQ를 실행하는 방법은 분명합니다. 클라이언트 설계 방법, 스윙을 실행하는 위치 및 드로잉을 보내는 방법을 알지 못합니다. E.G. 프로듀서는 ... 같을 것이다
public class Producer {
private static String url = ActiveMQConnection.DEFAULT_BROKER_URL;
private static String subject = "DRAWINGS";
public static void main(String[] args) throws JMSException {
ConnectionFactory connectionFactory =
new ActiveMQConnectionFactory(url);
Connection connection = connectionFactory.createConnection();
connection.start();
Session session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
Destination destination = session.createTopic(subject);
MessageProducer producer = session.createProducer(destination);
// how to implement producer as consumer as well and where to create the SWING
// and bind it to the client?
connection.close();
}
}
정말 도움이 필요합니다 ... –