Publish/Consume messages to topic-endpoints using Golang

I am using golang to connect to the solace client. Everything is working fine with queues. I am able to publish or receive messages. But then, when I am trying to connect to topic-endpoint, I can’t see it is connecting to the topic-endpoint. I am not getting any proper resource for the same.

Kindly help me, how can I connect to the topic-endpoint using golang.

Hi there,

I don’t think you should use topic-endpoint. Topic Endpoint feature is provided for JMS standard compatibility when you’re migrating from another vendor to Solace.
(and at the end of a migration, you’d move to queue subscription)

You’d prefer using either “topic subscription” or “queue binding”.

https://github.com/SolaceSamples/solace-samples-go/blob/main/patterns/direct_subscriber.go

  • Queue Subscription : Use that if you’re doing guaranteed Messaging.
    Both publisher and subscriber messages are acknowledged and messages are store on disk.
    You’re likely to want to use this I think. In the queue configuration, you set the subscriptions to topics, to choose which messages are stored on the queue (it can be changed dynamically via REST API, see SEMP) Publish to a topic
    solace-samples-go/patterns/guaranteed_publisher.go at main · SolaceSamples/solace-samples-go · GitHub Subscribe to a queue

https://github.com/SolaceSamples/solace-samples-go/blob/main/patterns/guaranteed_subscriber.go

  • If you need scalability of your microservices and ensure messages are consumed in the order they are produced check @Aaron video on Partitioned Queue :

Check our Developer resources here. :

In particular, have a look to API Tutorial & Codelabs :wink: