Hi there @cjasniew ! Ari has given you some really great pointers. Here’s a few additional thoughts:
If you don’t have admin access to your broker, you’ll probably have to liaise with your middleware team to help you configure some Guaranteed endpoints for you to use. Now, you may have the ability to create Endpoints dynamically (as determined by the settings in the client-profile that Ari showed), but this is not typically a best practice in production: to let applications create their own endpoints. Sometimes it’s required yes, but usually an admin-created durable Endpoint is what you need.
Now, in order for your message to be persisted in the broker so that your subscriber can receive it later, the Endpoint must already be created. If you create a mailbox after the message was attempted to deliver, where would it go? The Endpoint belongs to the consumer application… think of it as the consumer’s “online storage”. When the consumer/subscriber is connected to the Endpoint, it receives the message right away. And if it’s not connected, then the message will be stored inside the broker.
Finally, it’s good that you want to use Topics… this allows more flexible architecture. But I would recommend you to use Queues (Endpoints) instead of Topic Endpoints… they offer more functionality. The Solace best practice for Persistent/Guaranteed messaging is to create a Queue for your consumer/subscriber application, and then add topic subscriptions to that Queue so that it attracts messages published on topics (that match the subscription). Again, you may need to work with the admin/ops team to create the queue and add topic subscriptions to it.
Then your consumer connects to the queue, and your publisher publishes on topics that get matched to the Queue’s subscription and stored in the Queue. Publishers can publish to any number of topics… each message you send can go to a different topic if you want. It’s totally dynamic.