Skip to content

Commit

Permalink
Bug fix for triggered event subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
richturner committed Feb 13, 2019
1 parent e829a06 commit d889bf5
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.openremote.model.event.shared.SharedEvent;
import org.openremote.model.util.TextUtil;

import java.lang.reflect.Array;
import java.util.*;
import java.util.logging.Logger;

Expand Down Expand Up @@ -195,8 +196,9 @@ public <T extends SharedEvent> List<Message> splitForSubscribers(Exchange exchan
if (sessionSubscription.subscription.getFilter() == null
|| sessionSubscription.subscription.getFilter().apply(event)) {
LOG.fine("Creating message for subscribed session '" + sessionKey + "': " + event);

TriggeredEventSubscription<SharedEvent> triggeredEventSubscription = new TriggeredEventSubscription<>(new SharedEvent[] {event}, sessionSubscription.subscriptionId);
SharedEvent[] events = (SharedEvent[])Array.newInstance(event.getClass(), 1);
events[0] = event;
TriggeredEventSubscription triggeredEventSubscription = new TriggeredEventSubscription<>(events, sessionSubscription.subscriptionId);

if (sessionSubscription.subscription.getInternalConsumer() == null) {
Message msg = new DefaultMessage();
Expand Down

0 comments on commit d889bf5

Please sign in to comment.