Advertisement
Guest User

Untitled

a guest
Nov 14th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. package example;
  2.  
  3. import org.apache.activemq.pool.PooledConnectionFactory;
  4. import org.apache.activemq.command.ActiveMQTopic;
  5.  
  6. import javax.jms.*;
  7.  
  8. class Publisher {
  9.  
  10. public static void main(String []args) throws JMSException {
  11.  
  12. String user = env("ACTIVEMQ_USER", "activemq");
  13. String password = env("ACTIVEMQ_PASSWORD", "password");
  14. String host = env("ACTIVEMQ_HOST", "localhost");
  15. int port = Integer.parseInt(env("ACTIVEMQ_PORT", "61616"));
  16. String destination = arg(args, 0, "event");
  17.  
  18. int messages = 100000000;
  19. int size = 256;
  20.  
  21. String DATA = "abcdefghijklmnopqrstuvwxyz";
  22. String body = "";
  23. for( int i=0; i < size; i ++) {
  24. body += DATA.charAt(i%DATA.length());
  25. }
  26.  
  27. PooledConnectionFactory factory = new PooledConnectionFactory("tcp://" + host + ":" + port);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement