Skip to content

Commit

Permalink
Assorted jmslib and jakartalib fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
jiridanek committed Mar 26, 2023
1 parent f3b1cf2 commit b280c59
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private void unsubscribe() {
try {
session.unsubscribe(durableSubscriberName);
} catch (JMSException e) {
LOG.error("Error while unsubscribing durable subscriptor " + durableSubscriberName);
LOG.error("Error while unsubscribing durable subscriber " + durableSubscriberName);
e.printStackTrace();
} finally {
close(session);
Expand Down
5 changes: 2 additions & 3 deletions jakartalib/src/main/java/com/redhat/mqe/lib/SenderClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public void startClient() {
doTransaction(session, senderOptions.getOption(ClientOptions.TX_ENDLOOP_ACTION).getValue());
}
} catch (JMSException | IllegalArgumentException jmse) {
LOG.error("Error while sending a message!", jmse.getMessage());
LOG.error("Error while sending a message! {}", jmse.getMessage());
jmse.printStackTrace();
System.exit(1);
} finally {
Expand All @@ -191,8 +191,7 @@ public void startClient() {
protected static void setMessageProducer(ClientOptions senderOptions, MessageProducer producer) {
try {
// set delivery mode - durable/non-durable
String deliveryModeArg = senderOptions.getOption(ClientOptions.MSG_DURABLE).getValue().toLowerCase();
int deliveryMode = (deliveryModeArg.equals("true") || deliveryModeArg.equals("yes"))
int deliveryMode = Utils.convertOptionToBoolean(senderOptions.getOption(ClientOptions.MSG_DURABLE).getValue())
? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT;
producer.setDeliveryMode(deliveryMode);
// set time to live of message if provided
Expand Down
5 changes: 2 additions & 3 deletions jmslib/src/main/java/com/redhat/mqe/lib/SenderClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public void startClient() {
doTransaction(session, senderOptions.getOption(ClientOptions.TX_ENDLOOP_ACTION).getValue());
}
} catch (JMSException | IllegalArgumentException jmse) {
LOG.error("Error while sending a message!", jmse.getMessage());
LOG.error("Error while sending a message! {}", jmse.getMessage());
jmse.printStackTrace();
System.exit(1);
} finally {
Expand All @@ -191,8 +191,7 @@ public void startClient() {
protected static void setMessageProducer(ClientOptions senderOptions, MessageProducer producer) {
try {
// set delivery mode - durable/non-durable
String deliveryModeArg = senderOptions.getOption(ClientOptions.MSG_DURABLE).getValue().toLowerCase();
int deliveryMode = (deliveryModeArg.equals("true") || deliveryModeArg.equals("yes"))
int deliveryMode = Utils.convertOptionToBoolean(senderOptions.getOption(ClientOptions.MSG_DURABLE).getValue())
? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT;
producer.setDeliveryMode(deliveryMode);
// set time to live of message if provided
Expand Down

0 comments on commit b280c59

Please sign in to comment.