Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Wrap the data in another object, as Alerts expects it that way.
Browse files Browse the repository at this point in the history
  • Loading branch information
pilhuhn committed Feb 24, 2015
1 parent 614fd9a commit 8850498
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public interface Log {
@Message(id = 5001, value = "Pinging the remote threw an exception: %s")
void wPingExeption(String message);

@LogMessage
@LogMessage(level = Logger.Level.DEBUG)
@Message(id = 5002, value = "post status : %s")
void metricPostStatus(String s);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,17 @@ public void publishToTopic(String tenantId, List<SingleMetric> metrics) {

try ( ConnectionContextFactory factory = new ConnectionContextFactory(connectionFactory)) {

Map<String,Object> outer = new HashMap<>(1);

Map<String,Object> data = new HashMap<>(2);
data.put("tenantId",tenantId);
data.put("data",metrics);

outer.put("metricData",data);

Endpoint endpoint = new Endpoint(Endpoint.Type.TOPIC,topic.getTopicName());
ProducerConnectionContext pc = factory.createProducerConnectionContext(endpoint);
BasicMessage msg = new ObjectMessage(data);
BasicMessage msg = new ObjectMessage(outer);
MessageProcessor processor = new MessageProcessor();
processor.send(pc, msg);
}
Expand Down

0 comments on commit 8850498

Please sign in to comment.