feat(消息订阅): 新增消息接收原始报文日志
Motivation: 消息在分发处理前缺少接收环节的观测信息,排查消息丢失、重复消费或报文异常等问题时难以还原现场,需要在消息入口处记录完整的原始信息以支撑问题定位与链路追踪。 Changes: * 在消息处理入口记录原始报文的接收日志 * 日志包含订阅者名称、队列、来源及投递标签等上下文信息 * 完整输出消息体内容,便于还原消息接收现场
This commit is contained in:
@@ -129,6 +129,14 @@ func (s *Subscriber) ensureQueue(ch *amqp.Channel) error {
|
||||
}
|
||||
|
||||
func (s *Subscriber) handleDelivery(ch *amqp.Channel, d amqp.Delivery) {
|
||||
slog.Info("raw message received",
|
||||
"name", s.cfg.Name,
|
||||
"queue", s.cfg.Queue,
|
||||
"source", s.cfg.Source,
|
||||
"delivery_tag", d.DeliveryTag,
|
||||
"body", string(d.Body),
|
||||
)
|
||||
|
||||
disp := HandleMessage(context.Background(), HandleInput{
|
||||
Body: d.Body,
|
||||
Headers: map[string]any(d.Headers),
|
||||
|
||||
Reference in New Issue
Block a user