Skip to content

Commit 96d2e9f

Browse files
committed
make sure all pinned code is commented for easy access
1 parent 4c09f02 commit 96d2e9f

5 files changed

Lines changed: 12 additions & 10 deletions

File tree

src/main/java/io/nats/client/PullRequestOptions.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,14 @@ public String toJson() {
6060
JsonUtils.addFieldAsNanos(sb, IDLE_HEARTBEAT, idleHeartbeat);
6161
JsonUtils.addField(sb, GROUP, group);
6262
JsonUtils.addFieldWhenGtZero(sb, PRIORITY, priority);
63+
// TODO - PINNED CONSUMER SUPPORT
6364
// JsonUtils.addField(sb, ID, getPinId());
6465
JsonUtils.addField(sb, MIN_PENDING, minPending);
6566
JsonUtils.addField(sb, MIN_ACK_PENDING, minAckPending);
6667
return JsonUtils.endJson(sb).toString();
6768
}
6869

70+
// TODO - PINNED CONSUMER SUPPORT
6971
// protected String getPinId() {
7072
// return null;
7173
// }

src/main/java/io/nats/client/api/PriorityGroupState.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ public class PriorityGroupState {
3131
// private final String pinnedClientId;
3232
// private final ZonedDateTime pinnedTime;
3333

34-
3534
static List<PriorityGroupState> optionalListOf(JsonValue vpgStates) {
3635
return JsonValueUtils.optionalListOf(vpgStates, PriorityGroupState::new);
3736
}
3837

3938
PriorityGroupState(JsonValue vpgState) {
4039
group = JsonValueUtils.readString(vpgState, GROUP);
40+
// TODO - PINNED CONSUMER SUPPORT
4141
// pinnedClientId = JsonValueUtils.readString(vpgState, PINNED_CLIENT_ID);
4242
// pinnedTime = readDate(vpgState, PINNED_TS);
4343
}
@@ -51,6 +51,7 @@ public String getGroup() {
5151
return group;
5252
}
5353

54+
// TODO - PINNED CONSUMER SUPPORT
5455
// /**
5556
// * The generated ID of the pinned client
5657
// * @return the id
@@ -60,6 +61,7 @@ public String getGroup() {
6061
// return pinnedClientId;
6162
// }
6263

64+
// TODO - PINNED CONSUMER SUPPORT
6365
// /**
6466
// * The timestamp when the client was pinned
6567
// * @return the timestamp
@@ -73,6 +75,7 @@ public String getGroup() {
7375
public String toString() {
7476
return "PriorityGroupState{" +
7577
"group='" + group + '\'' +
78+
// TODO - PINNED CONSUMER SUPPORT
7679
// ", pinnedClientId='" + pinnedClientId + '\'' +
7780
// ", pinnedTime=" + pinnedTime +
7881
'}';

src/main/java/io/nats/client/api/SuccessApiResponse.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,12 @@ public class SuccessApiResponse extends ApiResponse<SuccessApiResponse> {
2323

2424
public SuccessApiResponse(Message msg) {
2525
super(msg);
26-
success = readBoolean(jv, SUCCESS);
27-
}
28-
29-
public SuccessApiResponse(Message msg, boolean successWhenNotError) {
30-
super(msg);
31-
if (successWhenNotError) {
26+
Boolean b = readBoolean(jv, SUCCESS, null);
27+
if (b == null) {
3228
success = !hasError();
3329
}
3430
else {
35-
success = readBoolean(jv, SUCCESS);
31+
success = b;
3632
}
3733
}
3834

src/main/java/io/nats/client/impl/NatsJetStreamManagement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ public boolean deleteMessage(String streamName, long seq, boolean erase) throws
374374
// String subj = String.format(JSAPI_CONSUMER_UNPIN, streamName, consumerName);
375375
// byte[] payload = String.format("{\"group\": \"%s\"}", consumerGroup).getBytes();
376376
// Message resp = makeRequestResponseRequired(subj, payload, getTimeout());
377-
// return new SuccessApiResponse(resp, true).throwOnHasError().getSuccess();
377+
// return new SuccessApiResponse(resp).throwOnHasError().getSuccess();
378378
// }
379379

380380
/**

src/main/java/io/nats/client/support/NatsJetStreamConstants.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ public interface NatsJetStreamConstants {
125125
String NATS_BATCH_SEQUENCE_HDR = "Nats-Batch-Sequence";
126126
String NATS_BATCH_COMMIT_HDR = "Nats-Batch-Commit";
127127

128-
String NATS_PIN_ID_HDR = "Nats-Pin-Id";
128+
// TODO - PINNED CONSUMER SUPPORT
129+
// String NATS_PIN_ID_HDR = "Nats-Pin-Id";
129130

130131
int JS_CONSUMER_NOT_FOUND_ERR = 10014;
131132
int JS_NO_MESSAGE_FOUND_ERR = 10037;

0 commit comments

Comments
 (0)