mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2025-12-30 05:09:44 -06:00
fix: don't need acks on queue checks (#926)
This commit is contained in:
@@ -136,6 +136,9 @@ type Message struct {
|
||||
// RetryDelay is the delay between retries.
|
||||
RetryDelay int `json:"retry_delay"`
|
||||
|
||||
// Whether the message should immediately expire if it reaches the queue without an active consumer.
|
||||
ImmediatelyExpire bool `json:"immediately_expire"`
|
||||
|
||||
// OtelCarrier is the OpenTelemetry carrier for the task.
|
||||
OtelCarrier map[string]string `json:"otel_carrier"`
|
||||
}
|
||||
|
||||
@@ -341,9 +341,15 @@ func (t *MessageQueueImpl) startPublishing() func() error {
|
||||
|
||||
t.l.Debug().Msgf("publishing msg %s to queue %s", msg.ID, msg.q.Name())
|
||||
|
||||
err = pub.PublishWithContext(ctx, "", msg.q.Name(), false, false, amqp.Publishing{
|
||||
pubMsg := amqp.Publishing{
|
||||
Body: body,
|
||||
})
|
||||
}
|
||||
|
||||
if msg.ImmediatelyExpire {
|
||||
pubMsg.Expiration = "0"
|
||||
}
|
||||
|
||||
err = pub.PublishWithContext(ctx, "", msg.q.Name(), false, false, pubMsg)
|
||||
|
||||
// retry failed delivery on the next session
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user