How to not lose a signal payload

I am going to compare this to Kafka. I can publish a message to Kafka and my consumer will fetch the message and ONLY commit it back to Kafka if my producer was successful in processing the message.
I can crash any time before the commit back, and the message is still in Kafka and will be delivered again when I restart.

I was looking into temporal as a replacement for Kafka and the temporalio signal stuff looks interesting.
[Temporal Signals Documentation] (How to use Signals in Go | Temporal Documentation) states the following

  • When a Signal is received for a running Workflow, Temporal persists the Signal event and payload in the Workflow history. The Workflow can then process the Signal at any time afterwards without the risk of losing the information.

my test case:

s.AddReceive(tripCh, func(c workflow.ReceiveChannel, more bool) {

       var trip TripEvent

       c.Receive(ctx, &trip)

       panic("Opps not going to process that message")

   })

Is that signal lost?

No, it is not lost. The workflow that throws panic is going to be blocked from making any progress until the code that throws it is fixed.

So what should I do in my for loop if the message is good but my downstream services are bad, hence I can’t process the message.
In the kafka scenario I simply don’t commit the message back to kafka to ack that I have processed it so stop sending it.

btw: I spin up a workflow and sit in a for loop forever making receive message calls.

In the Temporal scenario, you call Receive on the signal channel and don’t panic.