클라이언트 응용 프로그램에서 여러 소비자를 만들지 만 큐를 동시에 처리 할 수는 없습니다. 항상 단일 사용자 만 대기열 메시지를 처리합니다. 나는 이유를 모른다.hornetq에서 여러 클라이언트 소비자가 가능합니까?
Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
env.put(Context.PROVIDER_URL, "192.168.1.111:1099");
InitialContext ctx = new InitialContext(env);
ConnectionFactory cf = (ConnectionFactory) ctx.lookup("/ConnectionFactory");
Queue downQueue = (Queue) ctx.lookup("queue/DownQueue");
Session consumerSession = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
MessageConsumer consumer;
for (int i = 0; i < 2; i++) {
consumer = consumerSession.createConsumer(downQueue, "proxyId=0");
consumer.setMessageListener(listener);
}
여러 개의 동시 사용자가있는 대기열을 어떻게 처리합니까?
대단히 감사합니다. 큰 문제를 해결하도록 도와주세요. – flying