提交 ec1f9266 编写于 作者: Q qqeasonchen

optimize request/response examples

上级 53a6955e
......@@ -29,13 +29,11 @@ public class AsyncRequestProducer {
private static final InternalLogger log = ClientLogger.getLog();
public static void main(String[] args) throws MQClientException, InterruptedException {
String producerGroup = "ProducerGroup-Name";
String namesrvAddr = "10.255.2.37:9876;10.255.2.37:9875";
String producerGroup = "please_rename_unique_group_name";
String topic = "RequestTopic";
long ttl = 3000;
DefaultMQProducer producer = new DefaultMQProducer(producerGroup);
producer.setNamesrvAddr(namesrvAddr);
producer.start();
try {
......@@ -59,6 +57,7 @@ public class AsyncRequestProducer {
} catch (Exception e) {
log.warn("", e);
}
/* shutdown after your request callback is finished */
// producer.shutdown();
}
}
......@@ -28,13 +28,11 @@ public class RequestProducer {
private static final InternalLogger log = ClientLogger.getLog();
public static void main(String[] args) throws MQClientException, InterruptedException {
String producerGroup = "ProducerGroup-Name";
String namesrvAddr = "10.255.2.37:9876;10.255.2.37:9875";
String producerGroup = "please_rename_unique_group_name";
String topic = "RequestTopic";
long ttl = 3000;
DefaultMQProducer producer = new DefaultMQProducer(producerGroup);
producer.setNamesrvAddr(namesrvAddr);
producer.start();
try {
......
......@@ -38,12 +38,10 @@ public class ResponseConsumer {
private static final InternalLogger log = ClientLogger.getLog();
public static void main(String[] args) throws InterruptedException, MQClientException {
String consumerGroup = "ConsumeGroup-Name";
String namesrvAddr = "10.255.2.37:9873";
String consumerGroup = "please_rename_unique_group_name";
String topic = "RequestTopic";
DefaultMQPushConsumer consumer = new DefaultMQPushConsumer(consumerGroup);
consumer.setNamesrvAddr(namesrvAddr);
consumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_LAST_OFFSET);
consumer.registerMessageListener(new MessageListenerConcurrently() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册