Skip to content

Commit

Permalink
Fix exception when sending a message with event ID using transport pr…
Browse files Browse the repository at this point in the history
…otocol (#189)

* Do not check event Id before it is set

* Update readme and version

* Remove raw attribute from transport pin for sending
  • Loading branch information
OptimumCode authored Oct 11, 2023
1 parent 22f6d64 commit e359362
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Connect (4.0.0)
# Connect (4.0.1)

The "Connect" component is responsible for the communication with a target system.
This component implements the logic of the interaction protocol, receiving and sending messages from and to the system, respectively.
Expand Down Expand Up @@ -127,6 +127,12 @@ spec:

## Release notes

### 4.0.1

#### Fixed:

+ Exception when processing sent message with event ID

### 4.0.0

+ Migration to books/pages cradle 5.0.0
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
release_version = 4.0.0
release_version = 4.0.1
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void start() {

logger.info("Subscribing to transport queue with messages to send");

subscriberMonitor = router.subscribeAll(this, SEND_ATTRIBUTE, QueueAttribute.RAW.getValue());
subscriberMonitor = router.subscribeAll(this, SEND_ATTRIBUTE);
}

public void stop() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ public static MessageGroup convertToGroup(ConnectivityMessage connectivityMessag
if (SailfishMetadataExtensions.contains(sfMetadata, MetadataProperty.PARENT_EVENT_ID)) {
EventID parentEventID = SailfishMetadataExtensions.getParentEventID(sfMetadata);
// Should never happen because the Sailfish does not support sending multiple messages at once
if (rawMessage.getEventId() != null) {
LOGGER.warn("The parent ID is already set for message {}. Current ID: {}, New ID: {}",
messageId, rawMessage.getEventId(), parentEventID);
}
// This check is removed because raw message builder throws an IllegalStateException
// if the event ID is not set
// if (rawMessage.getEventId() != null) {
// LOGGER.warn("The parent ID is already set for message {}. Current ID: {}, New ID: {}",
// messageId, rawMessage.getEventId(), parentEventID);
// }
rawMessage.setEventId(EventUtilsKt.toTransport(parentEventID));
}
Map<String, String> props = defaultIfNull(getMessageProperties(sfMetadata), Collections.emptyMap());
Expand Down

0 comments on commit e359362

Please sign in to comment.