use of rocket.ProducerCluter in project warn-report by saaavsaaa.
the class TestRocketCluter method TestSend.
@Test
public void TestSend() throws MQClientException, InterruptedException, RemotingException, MQBrokerException {
final String producerGroup = "pg";
final String topic = "topicTest";
final String tag = "";
final String key = "aaa";
final String body = "it's body by qqq";
List<String> addresses = new ArrayList<String>();
addresses.add("192.168.1.44:9876");
addresses.add("192.168.1.45:9876");
ProducerCluter producer = new ProducerCluter(addresses, producerGroup);
Message msg = ProducerCluter.buildMessage(topic, tag, key, body);
boolean sendResult = producer.send(msg);
System.out.println(sendResult);
// Thread.sleep(1000*1000);
}
Aggregations