omarsmak commented on a change in pull request #5456:
URL: https://github.com/apache/camel/pull/5456#discussion_r619077666
##########
File path:
components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400MsgQueueProducer.java
##########
@@ -50,7 +50,12 @@ public void process(Exchange exchange) throws Exception {
private void process(MessageQueue queue, Exchange exchange) throws
Exception {
String msgText = exchange.getIn().getBody(String.class);
- queue.sendInformational(msgText);
+ byte[] messageKey = (byte[])
exchange.getIn().getHeader(Jt400Constants.MESSAGE_REPLYTO_KEY);
Review comment:
You can actually do something like this here instead of the explicit
casting
```suggestion
byte[] messageKey =
exchange.getIn().getHeader(Jt400Constants.MESSAGE_REPLYTO_KEY, byte[].class);
```
##########
File path:
components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400MsgQueueProducer.java
##########
@@ -50,7 +50,12 @@ public void process(Exchange exchange) throws Exception {
private void process(MessageQueue queue, Exchange exchange) throws
Exception {
String msgText = exchange.getIn().getBody(String.class);
- queue.sendInformational(msgText);
+ byte[] messageKey = (byte[])
exchange.getIn().getHeader(Jt400Constants.MESSAGE_REPLYTO_KEY);
+ if (null != messageKey && !msgText.isEmpty()) {
Review comment:
For better readability here, I would think this may make more sense:
```suggestion
if (ObjectHelper.isNotEmpty(messageKey) &&
ObjectHelper.isNotEmpty(msgText)) {
```
Whereby `ObjectHelper` is from `org.apache.camel.util.ObjectHelper`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]