Skip to content

Commit

Permalink
Remove redundant consumer cancel handling code from stream examples
Browse files Browse the repository at this point in the history
  • Loading branch information
cressie176 committed Apr 5, 2024
1 parent df87559 commit 66b6b39
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,6 @@ You also need to think about how you will [track the consumer offset](https://ww
const subscription = await broker.subscribe('/my-queue', overrides);

subscription.on('message', async (message, content, ackOrNack) => {
if (message === null) return;
const currentOffset = message.properties.headers['x-stream-offset'];
try {
await handleMessage(content);
Expand Down
1 change: 0 additions & 1 deletion examples/streams/subscriber.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Rascal.Broker.create(Rascal.withDefaultConfig(config), (err, broker) => {
broker.subscribe('demo_sub', overrides, (err, subscription) => {
if (err) throw err;
subscription.on('message', (message, content, ackOrNack) => {
if (message === null) return console.log('Received null message');
console.log(`Received message: ${message.properties.headers['x-stream-offset']}`)
ackOrNack();
});
Expand Down

0 comments on commit 66b6b39

Please sign in to comment.