Storing IMessage and ITopic

Hi,
Do we have any way by which we can store IMessage or ITopic in our file system?
Thanks,
Prasoon

Answers

  • ChristianHoltfurth
    ChristianHoltfurth Member, Employee Posts: 68 Solace Employee

    Hi Prasoon,
    What exactly are you trying to achieve?
    Storing a message may make sense, if you want to process it later... but you could also leave it on the broker until your application is ready to do so. So why store it in the file system? What's the purpose?
    A Solace topic is another thing though... Solace topics are basically just tags on a message. A subscription to a topic is basically a string though. What would storing a topic on your file system achieve? Do you want to "remember" your topic subscription strings for later?
    In order to answer your question on how to achieve this, it would also be good, if you can mention the programming language/API that you are using.
    Best regards,
    Christian

  • prasoonSolace
    prasoonSolace Member Posts: 9

    Hi,
    We are using c sharp. Our scenario is even when environment is down then also we should be able to see data in our application. So what we are thinking is, when environment is up we will store messages in flat files and then when environmnet is down we will push the data from the filesystem.
    Any suggestion on this will be really helpful.

    Thanks,
    Prasoon

  • ChristianHoltfurth
    ChristianHoltfurth Member, Employee Posts: 68 Solace Employee

    Sorry @prasoonSolace ,
    I somehow missed your response. Have you considered spinning up a broker next to your application (on the same host)?
    That way you can always send and receive messages to/from your local broker.
    To communicate with other systems, you can then mesh that broker with other brokers.

    Alternatively, if that is not possible, feel free to define your own file-format and simply store the content of the message in whatever format you prefer... you could make your own serialisable representation of your data. Then whenever you are connected/ready to send, simply put that data/container in the body of your message.
    Makes sense?

    If not, please provide a bit more detail around the use case and I may be able to give further advise.

  • TomF
    TomF Member, Employee Posts: 406 Solace Employee

    @prasoonSolace have you thought about HA and DR? You say "even when an environment is down" which sounds like you're doing some kind of resilience planning. Having the broker able to access the message state is far better than having to save messages to files and then try to understand how to synchronise the latest broker state to whatever landed on your file system. HA, for example, gives you a backup broker to connect to even if a primary broker fails.