[jboss-user] [JBoss Messaging] - Re: Sending 512 kb of message Failing....

john_jbm do-not-reply at jboss.com
Tue May 13 04:29:05 EDT 2008


My code snippet i like this

                                StringBuilder message = new StringBuilder();
				for (int i = 0; i < 32768; i++) {
					message.append("aaaaaaaaaaaaaaaa");
				}
                                 // 32768*16 == 512 kb

TextMessage mesg = null;

		try {

			if (session != null) {
				mesg = session.createTextMessage(message);
				} else {
				throw new DataTransportException("Session object not found");
			}

			
			if (producer != null) {
				try {
					producer.send(mesg, DeliveryMode.PERSISTENT, 9, 0);
				} catch (Exception e) {
					System.out.println(e.getMessage());
					throw new DataTransportException("Not able to send message");
				}
			}

			System.out.println("Sending message :: " + message);

		} catch (Exception e) {
			System.out.println("Error In Sending Message :: " + message
					+ " The error is :: " + e.getMessage());
			throw new DataTransportException("Message Not Send");
		}

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4150264#4150264

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4150264



More information about the jboss-user mailing list