Fix the issue that exception callback can not be called when doing async sending message with null topic
diff --git a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ProducerImpl.java b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ProducerImpl.java
index bd1dede..6118435 100644
--- a/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ProducerImpl.java
+++ b/ons-core/ons-client/src/main/java/org/apache/rocketmq/ons/api/impl/rocketmq/ProducerImpl.java
@@ -192,11 +192,11 @@
@Override
public void onException(Throwable e) {
- String topic = new String(message.getTopic());
+ //String topic = new String(message.getTopic());
String msgId = new String(message.getMsgID());
- ONSClientException onsEx = checkProducerException(topic, msgId, e);
+ ONSClientException onsEx = checkProducerException(message.getTopic(), msgId, e);
OnExceptionContext context = new OnExceptionContext();
- context.setTopic(topic);
+ context.setTopic(message.getTopic());
context.setMessageId(msgId);
context.setException(onsEx);
sendCallback.onException(context);