Skip to content

Commit

Permalink
Pull request #563: Fix AlertSender to include messageId
Browse files Browse the repository at this point in the history
Merge in MC/connect from pr4408-alertsender-include-messageid to development

* commit 'abd52e2f572b770e0231cfdce76e7097fc45e6c8':
  Fix AlertSender to include messageId
  • Loading branch information
narupley committed Apr 21, 2022
2 parents 5739bc6 + abd52e2 commit 1f82b25
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class AlertSender {
private EventController eventController = ControllerFactory.getFactory().createEventController();
private String channelId;
private Integer metaDataId;
private Long messageId;
private String connectorName;

/**
Expand All @@ -43,6 +44,7 @@ public AlertSender(String channelId) {
public AlertSender(ImmutableConnectorMessage connectorMessage) {
channelId = connectorMessage.getChannelId();
metaDataId = connectorMessage.getMetaDataId();
messageId = connectorMessage.getMessageId();
connectorName = connectorMessage.getConnectorName();
}

Expand All @@ -53,6 +55,6 @@ public AlertSender(ImmutableConnectorMessage connectorMessage) {
* A custom error message to include with the error event.
*/
public void sendAlert(String errorMessage) {
eventController.dispatchEvent(new ErrorEvent(channelId, metaDataId, null, ErrorEventType.USER_DEFINED_TRANSFORMER, connectorName, null, errorMessage, null));
eventController.dispatchEvent(new ErrorEvent(channelId, metaDataId, messageId, ErrorEventType.USER_DEFINED_TRANSFORMER, connectorName, null, errorMessage, null));
}
}

0 comments on commit 1f82b25

Please sign in to comment.