Skip to content

Commit

Permalink
[TH2-5073] Different pin attributes for different send: ParsedMessage…
Browse files Browse the repository at this point in the history
… send and RawMessage send (#122)
  • Loading branch information
isengrims authored Sep 19, 2023
1 parent b44e6eb commit 434d5ce
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# th2 act template (5.1.0)
# th2 act template (5.1.1)

## Overview

Expand Down Expand Up @@ -49,6 +49,7 @@ spec:
connection-type: mq
attributes:
- publish
- send
- transport-group
filters:
- metadata:
Expand All @@ -59,6 +60,7 @@ spec:
connection-type: mq
attributes:
- publish
- send
- transport-group
filters:
- metadata:
Expand Down Expand Up @@ -98,6 +100,9 @@ the `protobuf-description-base64` label. Such descriptors can be used to interac

## Release Notes

### 5.1.1
+ Use pins with `send` pin attribute for parsed messages sends.

### 5.1.0
+ Added RPC to send raw messages.
+ Updated grpc-act-template to `4.2.0`
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
release_version=5.1.0
release_version=5.1.1
nexus_url=
nexus_user=
nexus_password=
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/exactpro/th2/act/ActHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
public class ActHandler extends ActImplBase {
private static final int DEFAULT_RESPONSE_TIMEOUT = 10_000;
private static final String SEND_RAW_QUEUE_ATTRIBUTE = "send_raw";
private static final String SEND_QUEUE_ATTRIBUTE = "send";
private static final Logger LOGGER = LoggerFactory.getLogger(ActHandler.class);

private final Check1Service check1Service;
Expand Down Expand Up @@ -565,7 +566,7 @@ private void sendMessage(Message message, EventID parentEventId) throws IOExcept
//May be use in future for filtering
//request.getConnectionId().getSessionAlias();
MessageID messageID = message.getMetadata().getId();
messageRouter.send(toBatch(toGroup(parsedMessage), messageID.getBookName(), messageID.getConnectionId().getSessionGroup()));
messageRouter.send(toBatch(toGroup(parsedMessage), messageID.getBookName(), messageID.getConnectionId().getSessionGroup()), SEND_QUEUE_ATTRIBUTE);
//TODO remove after solving issue TH2-217
//TODO process response
EventBatch eventBatch = EventBatch.newBuilder()
Expand Down Expand Up @@ -613,7 +614,7 @@ private com.exactpro.th2.common.grpc.Event createSendMessageEvent(ParsedMessage
private com.exactpro.th2.common.grpc.Event createSendRawMessageEvent(RawMessage message, EventID parentEventId) throws IOException {
Event event = start()
.name("Sent raw message to connectivity");
com.exactpro.th2.common.event.bean.Message messageBean = EventUtils.createMessageBean(ByteBufUtil.hexDump(message.getBody()));
com.exactpro.th2.common.event.bean.Message messageBean = EventUtils.createMessageBean(ByteBufUtil.prettyHexDump(message.getBody()));
event.status(Status.PASSED);
event.bodyData(messageBean);
event.type("Outgoing message");
Expand Down

0 comments on commit 434d5ce

Please sign in to comment.