You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by "zhaoyi0113@gmail.com" <zh...@gmail.com> on 2010/09/15 05:39:53 UTC

An error when connect to qpid broker

I am using qpid-java 0.6 and java client. When I connect to the broker, I
will get below warning.

WARN  ClientDelegate - Ignoring the idle timeout 0 set by the connection,
using the brokers max value 65535

The code I am using is listed below. Does anyone know how to solve this
warning?



			// Load JNDI properties
			Properties properties = new Properties();
			properties.put(Context.INITIAL_CONTEXT_FACTORY,
					"org.apache.qpid.jndi.PropertiesFileInitialContextFactory");
			properties
					.put("connectionfactory.local",
						
"amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'");
			properties.put("destination.directQueue",
					"direct://amq.direct//queue1?routingkey='queue1'");

			Context ctx = new InitialContext(properties);

			Destination destination = (Destination) ctx.lookup("directQueue");
			//
			ConnectionFactory conFac = (ConnectionFactory) ctx.lookup("local");
			Connection connection = conFac.createConnection();
			//
			// connection.setExceptionListener(new ExceptionListener() {
			// public void onException(JMSException jmse) {
			// System.exit(0);
			// }
			// });
			//
			//
			Session session = connection.createSession(false,
					Session.AUTO_ACKNOWLEDGE);
			//
			//
			MessageConsumer messageConsumer = session
					.createConsumer(destination);
			//
			messageConsumer.setMessageListener(new MessageListener() {
				int i = 0;

				public void onMessage(Message msg) {
					BytesMessage message = (BytesMessage) msg;
					try {
						byte bytes[] = new byte[(int) message.getBodyLength()];
						message.readBytes(bytes);
						GeDataInputContext context = new GeDataInputContext(
								new ByteArrayInputStream(bytes));
						GeSerializable obj = context.readObjectMsg();
						System.out.println((i++) + ":" + obj);
					} catch (Exception ex) {
						ex.printStackTrace();
					}
				}
			});

			connection.start();

			synchronized (_lock) {
				while (!_finished && !_failed) {
					_lock.wait();
				}
			}

			connection.close();

			ctx.close();

		
-- 
View this message in context: http://apache-qpid-users.2158936.n2.nabble.com/An-error-when-connect-to-qpid-broker-tp5532941p5532941.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org