jms - HornetQ 2.2.5 Embeded Example Exception -


I'm new to Hornetk and I'm testing Singtekyu examples. Example I'm getting an exception when embedded example. Java (resides in: hornetq-2.2.5. Last \ example \ core \ embedded \ src \ org \ hornetq \ core \ example). I made some changes in that example and got the exception. When I made the change, I sent the process and consumption process to the loop of 1 00,000 currency. The code is:

  System.out.println ("Creator:"); System.out.println ("Start:" + New Date ()); For (Int i = 0; i & lt; 100000; i ++) {message.putStringProperty (Prop name, "Message:" + i); Producer.send (message); } System.out.println ("End date:" + New date ()); // Step 7. Make Message Consumer and Start the Connection Client Consumer Message Consumer = session.createConsumer (queueName); Session.start (); // Step 8. Get Message Println ("Consumer:"); System.out.println ("Start:" + New Date ()); For (int i = 0; i <100000; i ++) {client message received = message consumer Receive (); Println (messageReceived.getStringProperty (propName)); } System.out.println ("End date:" + New date ());   

The manufacturer works well, and the client gives me an exception after reading 18k or 13k msges. Stack trace:

  [java] message: 18384 [Java] Sep 2 ,, 2011 11:15:29 org.hornetq.core.logging.impl.JULLogDelegate information [Java] information : HornetQ Server Version 2.2.5.Final (HQ_2_2_5_FINAL_AS7, 121) [588e32ee-d493-11e0-b759-0026b6a94d9b] Closed [java] HornetQException [errorCode = 102 Message = Consumer Closed] [Java] org.hornetq On .core On client.impl.ClientConsumerImpl.checkClosed (C lientConsumerImpl.java:811) org.hornetq.core.client.impl.ClientConsumerImpl.receive (clien tConsumerImpl.java:163) [Java] [Java] on org.hornetq.core. client.impl.ClientConsumerImpl.receive (clien tConsumerImpl.java:364) [Java] on org.hornetq.core.example.EmbeddedExample.main (EmbeddedExample Java: 107) [java] Java Result: -1 BUILD failed C: \ hornetq -2.2.5.Final \ example \ core \ embedded \ build.xml: 40 :? EmbeddedExample   

How do I overcome this exception

example Only VM will start with 50 M, and on your example you will not be enough for 50 M, after the end of the S 100K message.

do I have here is not a change, but I can run instances with the 100K messages provide more storage at Bildkod.

Besides, you were getting some exceptions before interrupting the communication and made to close the session. Besides, messaging systems are asynchronous, therefore I Offer to change your sending block to:

 for  (int i = 0; i & lt; 100000; i ++) {message = sesison.createMessage (true) ); // Send message to it. Input stringproperty (Prop Name, "Message:" + i); Producer.send (message); }   

And you should also have an ACK on the consumer. Otherwise the message will still be in memory.

An intentional example was to show how to embed Hornets. Other uses such as decking and other examples for production.

 for  (int i = 0; i & lt; 100000; i ++) {client message received = message consumer. Receive (); MessageReceived.acknowledge (); Println (messageReceived.getStringProperty (propName)); }    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -