broker: DeadLetterReads grants only what a pulled ordered consumer needs, as mesh-sdk buscompose (issue 734, review round 1)
NATS-native research piece: none moved; the copy stays in step with mesh-sdk until mesh-grants composes the list.
This commit is contained in:
@@ -157,7 +157,7 @@ func SeatTrafficOf(module string, holds, uses, watches []Seat) SeatTraffic {
|
|||||||
|
|
||||||
// DeadLetterReads is what a user of a seat pulled by kind is granted to hear which of the asks it put the seat's workers
|
// DeadLetterReads is what a user of a seat pulled by kind is granted to hear which of the asks it put the seat's workers
|
||||||
// gave up on (novox/hq issue 734): an ordered consumer on DEAD_LETTERS filtered to the copies the controller keeps of that
|
// gave up on (novox/hq issue 734): an ordered consumer on DEAD_LETTERS filtered to the copies the controller keeps of that
|
||||||
// seat's stream (DeadLetterSubject(stream, *)), pulled or pushed, its deletion and its flow control. A copy carries the ask's own message id
|
// seat's stream (DeadLetterSubject(stream, *)), pulled, and its deletion. A copy carries the ask's own message id
|
||||||
// (Mesh-Dead-Msg-Id), so the asker ends the step it waits for instead of waiting for ever; it reads the seat's dead
|
// (Mesh-Dead-Msg-Id), so the asker ends the step it waits for instead of waiting for ever; it reads the seat's dead
|
||||||
// letters and no other stream's, and changes none.
|
// letters and no other stream's, and changes none.
|
||||||
func DeadLetterReads(stream string) []string {
|
func DeadLetterReads(stream string) []string {
|
||||||
@@ -165,8 +165,7 @@ func DeadLetterReads(stream string) []string {
|
|||||||
"$JS.API.STREAM.INFO." + DeadLettersStream,
|
"$JS.API.STREAM.INFO." + DeadLettersStream,
|
||||||
"$JS.API.CONSUMER.CREATE." + DeadLettersStream + ".*." + DeadLetterSubject(stream, ">"),
|
"$JS.API.CONSUMER.CREATE." + DeadLettersStream + ".*." + DeadLetterSubject(stream, ">"),
|
||||||
"$JS.API.CONSUMER.MSG.NEXT." + DeadLettersStream + ".*",
|
"$JS.API.CONSUMER.MSG.NEXT." + DeadLettersStream + ".*",
|
||||||
"$JS.API.CONSUMER.DELETE." + DeadLettersStream + ".>",
|
"$JS.API.CONSUMER.DELETE." + DeadLettersStream + ".*",
|
||||||
"$JS.FC." + DeadLettersStream + ".>",
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -410,6 +410,7 @@ func TestTheBuilderMayAskABuildSeatAndASessionMayNot(t *testing.T) {
|
|||||||
"$JS.API.CONSUMER.MSG.NEXT.DEAD_LETTERS.x1": true,
|
"$JS.API.CONSUMER.MSG.NEXT.DEAD_LETTERS.x1": true,
|
||||||
"$JS.API.CONSUMER.CREATE.DEAD_LETTERS.x1.mesh.events.dead.EVENTS.>": false,
|
"$JS.API.CONSUMER.CREATE.DEAD_LETTERS.x1.mesh.events.dead.EVENTS.>": false,
|
||||||
"$JS.API.STREAM.PURGE.DEAD_LETTERS": false,
|
"$JS.API.STREAM.PURGE.DEAD_LETTERS": false,
|
||||||
|
"$JS.FC.DEAD_LETTERS.x1": false,
|
||||||
} {
|
} {
|
||||||
if got := allowed(builder.Publish, subject); got != want {
|
if got := allowed(builder.Publish, subject); got != want {
|
||||||
t.Errorf("the builder may publish %s: %v, want %v", subject, got, want)
|
t.Errorf("the builder may publish %s: %v, want %v", subject, got, want)
|
||||||
|
|||||||
Reference in New Issue
Block a user