use of rocket.Producer in project warn-report by saaavsaaa.
the class TestProcess method TestSend.
// sh mqadmin updateTopic -b 192.168.3.62 -n 192.168.3.62:9876 -t 'testTopic'
@Test
public void TestSend() throws MQClientException, InterruptedException, RemotingException, MQBrokerException {
final String address = "192.168.1.44:9876;192.168.1.45:9876";
final String producerGroup = "pg";
final String topic = "topicTest";
final String tag = "";
final String key = "aaa";
final String body = "it's body by aaa";
Producer producer = new Producer(address, producerGroup);
Message msg = Producer.buildMessage(topic, tag, key, body);
SendResult sendResult = producer.send(msg);
System.out.println(sendResult);
}
Aggregations