Skip to content
Snippets Groups Projects
Commit c19582d1 authored by Steffen Schulze's avatar Steffen Schulze
Browse files

topic fix

parent 7b66c784
No related branches found
No related tags found
1 merge request!10Refactoring
Pipeline #42093 passed with warnings with stages
in 3 minutes and 30 seconds
......@@ -24,9 +24,9 @@ func SendMessage(message map[string]interface{}, mediatee *database.Mediatee) er
switch config.CurrentConfiguration.CloudForwarding.Protocol {
case config.HTTP:
return sendCloudEvent(message, mediatee)
return sendCloudEvent(message, mediatee, mediatee.Topic)
case config.NATS:
return sendCloudEvent(message, mediatee)
return sendCloudEvent(message, mediatee, mediatee.Topic)
case config.HYBRID:
// implement hybrid mode if cloud event provider supports it
return errors.New("hybrid mode not supported: message will not be sent")
......@@ -116,8 +116,7 @@ func ReceiveMessage(mediator *mediator.Mediator) {
wg.Wait()
}
func sendCloudEvent(message any, mediatee *database.Mediatee) (err error) {
topic := mediatee.Topic
func sendCloudEvent(message any, mediatee *database.Mediatee, topic string) (err error) {
if topic == "" {
topic = "default-http"
}
......
......@@ -398,7 +398,7 @@ func (h *CoordinateMediation) handleMediationRequest(message didcomm.Message, be
Did: mediatee.RoutingKey,
}
err = sendCloudEvent(inv, mediatee)
err = sendCloudEvent(inv, mediatee, config.CurrentConfiguration.CloudForwarding.Nats.Topic)
return response, err
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment