summaryrefslogtreecommitdiffstats
path: root/holmes-actions/src/main
diff options
context:
space:
mode:
authoryoubowu <wu.youbo@zte.com.cn>2017-03-01 14:08:54 +0800
committer6092002067 <wu.youbo@zte.com.cn>2017-03-01 17:14:00 +0800
commit23dd65b8421041947027b3b5ab87ddf3b379b5ba (patch)
tree1228b578ca88a167c07cb572781978ff265c68e0 /holmes-actions/src/main
parent57d0c9e7572a9de13c7e26f57e98e9a0cdd564a7 (diff)
Fix unit test
Issue-ID:HOLMES-51 Change-Id: I1fc4a6da12f085cbb8ad2a36ef630823e5707ae3 Signed-off-by:youbowu <wu.youbo@zte.com.cn>
Diffstat (limited to 'holmes-actions/src/main')
-rw-r--r--holmes-actions/src/main/java/org/openo/holmes/common/producer/MQProducer.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/producer/MQProducer.java b/holmes-actions/src/main/java/org/openo/holmes/common/producer/MQProducer.java
index 8cb3d2b..21b62f3 100644
--- a/holmes-actions/src/main/java/org/openo/holmes/common/producer/MQProducer.java
+++ b/holmes-actions/src/main/java/org/openo/holmes/common/producer/MQProducer.java
@@ -55,14 +55,18 @@ public class MQProducer {
Serializable msgEntity = (Serializable) t;
Connection connection = null;
Session session;
- Destination destination;
+ Destination destination = null;
MessageProducer messageProducer;
try {
connection = connectionFactory.createConnection();
connection.start();
session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
- destination = session.createTopic(AlarmConst.MQ_TOPIC_NAME_ALARMS_CORRELATION);
+ if (t instanceof CorrelationResult) {
+ destination = session.createTopic(AlarmConst.MQ_TOPIC_NAME_ALARMS_CORRELATION);
+ } else if (t instanceof Alarm) {
+ destination = session.createTopic(AlarmConst.MQ_TOPIC_NAME_ALARM);
+ }
messageProducer = session.createProducer(destination);
ObjectMessage message = session.createObjectMessage(msgEntity);
messageProducer.send(message);