nats: periods and underscores are forbidden and cause silent failure

This commit is contained in:
Quaternions 2024-12-13 18:01:47 -08:00
parent 3739ff011e
commit 3a6a62fb7c
2 changed files with 4 additions and 4 deletions

View File

@ -313,7 +313,7 @@ func (svc *Service) ActionSubmissionTriggerPublish(ctx context.Context, params a
return err return err
} }
svc.Nats.Publish("maptest.submissions.publish.new", []byte(j)) svc.Nats.Publish("maptest.submissions.publishnew", []byte(j))
} else { } else {
// this is a map fix // this is a map fix
publish_fix_request := model.PublishFixRequest{ publish_fix_request := model.PublishFixRequest{
@ -328,7 +328,7 @@ func (svc *Service) ActionSubmissionTriggerPublish(ctx context.Context, params a
return err return err
} }
svc.Nats.Publish("maptest.submissions.publish.fix", []byte(j)) svc.Nats.Publish("maptest.submissions.publishfix", []byte(j))
} }
return nil return nil

View File

@ -39,8 +39,8 @@ impl MessageHandler{
let message=message_result.map_err(HandleMessageError::Messages)?; let message=message_result.map_err(HandleMessageError::Messages)?;
message.double_ack().await.map_err(HandleMessageError::DoubleAck)?; message.double_ack().await.map_err(HandleMessageError::DoubleAck)?;
match message.subject.as_str(){ match message.subject.as_str(){
"maptest.submissions.publish.new"=>self.publish_new.publish(message).await.map_err(HandleMessageError::PublishNew), "maptest.submissions.publishnew"=>self.publish_new.publish(message).await.map_err(HandleMessageError::PublishNew),
"maptest.submissions.publish.fix"=>self.publish_fix.publish(message).await.map_err(HandleMessageError::PublishFix), "maptest.submissions.publishfix"=>self.publish_fix.publish(message).await.map_err(HandleMessageError::PublishFix),
"maptest.submissions.validate"=>self.validator.validate(message).await.map_err(HandleMessageError::Validation), "maptest.submissions.validate"=>self.validator.validate(message).await.map_err(HandleMessageError::Validation),
other=>Err(HandleMessageError::UnknownSubject(other.to_owned())) other=>Err(HandleMessageError::UnknownSubject(other.to_owned()))
} }