Comments (4)
I want to delete a message to prevent consuming, but for call Delete method I need to pass message ID which you didn't set on XAdd method here:
https://github.com/vmihailenco/taskq/blob/master/redisq/queue.go#L168
Redis client XAdd
method return generated unique ID in response.
queue.add
method accept message as reference so you can set returned generated ID on message ID to updated passed message object:
stringCmd := pipe.XAdd(&redis.XAddArgs{
Stream: q.stream,
Values: map[string]interface{}{
"body": body,
},
})
msg.ID = stringCmd.Val()
return stringCmd.Err()
My problem is that I can't access message ID after adding it to queue for use it to delete message in future before consuming.
from taskq.
Running into the same problem. I agree with @sajjadrad that the msg.ID should be the one created by redis, otherwise the delete does not work.
from taskq.
I can't say I follow what you are trying to say. msg.ID
is set in https://github.com/vmihailenco/taskq/blob/master/redisq/queue.go#L408
from taskq.
Ah. Just seeing this. I am guessing this is related to #143 ?
from taskq.
Related Issues (20)
- memqueue_test.go makes use of Redis HOT 7
- Named tasks can not be recreated after they complete HOT 4
- How to stop a running queue at runtime?? HOT 2
- Please add q.wg.Wait() to redisq.go HOT 2
- Why is the consumer started in the memqueue.NewQueue() method? HOT 1
- Redis queue visibility HOT 3
- message receive delay when using SQS HOT 1
- Redisq Queue Scheduler Time Sleep Option HOT 2
- Setting WorkerLimit in QueueOptions throws a nil pointer while using a Memqueue HOT 1
- Nil context field on message
- Support Google PubSub HOT 1
- Is taskq production ready? HOT 3
- add message to queue that has a timeout to be processed HOT 1
- I encountered a version conflict when using this project HOT 4
- System resource checks in kubernetes environments
- invalid memory address or nil pointer dereference
- taskqotel v4.0.0-beta.4 not exists
- message's Context doesn't save when a worker fetch the message in v3
- v4 is not working with github.com/redis/[email protected] HOT 1
- v4 is not working with github.com/redis/go-redis/[email protected]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from taskq.