Skip to content

Commit f567c27

Browse files
authored
Issue 33 (#35)
* updated build file to always pull most recent JARs * updated comment for clarity * added comment for async publish as well
1 parent 58faaae commit f567c27

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ repositories {
5252

5353
dependencies {
5454
// Solace Messaging API for Java Dependencies
55-
implementation group: 'com.solace', name: 'solace-messaging-client', version: '1.4.0'
55+
implementation group: 'com.solace', name: 'solace-messaging-client', version: '1.+'
5656

57-
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.17.2'
58-
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.17.2'
59-
implementation group: 'org.apache.logging.log4j', name: 'log4j-jcl', version: '2.17.2'
57+
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.+'
58+
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.+'
59+
implementation group: 'org.apache.logging.log4j', name: 'log4j-jcl', version: '2.+'
6060
}
6161

6262

src/main/java/com/solace/samples/java/patterns/GuaranteedBlockingPublisher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public static void main(String... args) throws IOException {
121121
.append("/pers/pub/").append(chosenCharacter).toString();
122122
try {
123123
// send the message
124-
publisher.publishAwaitAcknowledgement(message,Topic.of(topicString),2000L); // wait up to 2 seconds?
124+
publisher.publishAwaitAcknowledgement(message,Topic.of(topicString), 2000L); // wait up to 2 seconds for ACK
125125
msgSentCounter++; // add one
126126
} catch (PubSubPlusClientException e) { // could be different types
127127
logger.warn(String.format("NACK for Message %s - %s", message, e));

src/main/java/com/solace/samples/java/patterns/GuaranteedNonBlockingPublisher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public static void main(String... args) throws IOException, InterruptedException
134134
OutboundMessage message = messageBuilder.build(payload); // binary payload message
135135
// dynamic topics!!
136136
String topicString = new StringBuilder(TOPIC_PREFIX).append("java/pers/pub/").append(chosenCharacter).toString();
137-
publisher.publish(message,Topic.of(topicString)); // send the message
137+
publisher.publish(message,Topic.of(topicString)); // send the message asynchronously, ACK received later on callback
138138
msgSentCounter++; // add one
139139
} catch (RuntimeException e) { // threw from publish(), only thing that is throwing here, but keep trying (unless shutdown?)
140140
logger.warn("### Caught while trying to publisher.publish()",e);

0 commit comments

Comments
 (0)