Well, there is no need for auto-reconnect in the concrete example. The
problem seems to be that the sample you are running is doing something
different than you expect:
When I run the sample (modified as you describe) through the debugger
in Visual Studio I get a MessagePublicationException when the backend
tries to "publish" the HelloWorldResponseMessage.
This is because the main method in the program.cs for the backend
calls a utility method, QueueUtil.PrepareQueue("backend");, to setup
the queues needed for the sample. This method cleans up any existing
queue storage and thereby also any saved subscriptions.
If you modify the QueueUtil.PrepareQueue() method and remove the
"delete" calls you can actually make it work when restarting the
backend (I don't know if this causes other problems though...?)
Regarding the auto subscribe part I mentioned:
The service bus instance in the two client processes in the sample are
actually sending an AddSubscription message to the backend for the
HelloWorldResponseMessage. The service bus is looking at which message
consumers exist (classes implementing ConsumerOf interface) and sends
the AddSubscription message to the endpoint configured in the
"messages" element in App.config for the namespace matching the
message class. This process is what I refer to as auto subscriptions.
You can disable this and manage the subscriptions yourself, but that's
another story :)
This is also mentioned here:
http://hibernatingrhinos.com/open-source/rhino-service-bus
Hope this help you.
regards
René
On 25 Maj, 12:49, Michael Kempe <[email protected]> wrote:
> Hi, René,
>
> What are these auto-subscriptions?
>
> I'm using the samples fromhttp://github.com/BjRo/LearningRhinoServiceBus
> -
> there you can find a sample called
> E4_PubSub_using_Rhino.Queues_as_transport.
>
> I changed the Client (Program.cs) in that way that the client will
> send a message each time I press Enter-Key.
> So I start the sample (Backend, Client & Client2) and send a message
> from client - everything works fine. But when I restart
> the backend (the server) and send a message again (client is still
> running) then the message disappears without any info.
>
> That's why I'm asking for something like an auto-reconnect!
>
> Kind regards.
>
> Micha
>
> On May 25, 9:47 am, René M. A <[email protected]> wrote:
>
>
>
>
>
>
>
> > How are you subscribing to the server? If you use auto subscriptions
> > they are by default persistent on the server (in the subscriptions sub-
> > queue) and will exist between server restarts.
>
> > On 23 Maj, 13:28, Michael Kempe <[email protected]> wrote:
>
> > > Hi!
>
> > > Is there a way that a client (subscriber !!!) stays connected to a
> > > server when that server was restarted? I mean is there something like
> > > an auto-reconnect????
>
> > > I hope someone can give me advise!
>
> > > Thanks in advance. Micha- Hide quoted text -
>
> > - Show quoted text -
--
You received this message because you are subscribed to the Google Groups
"Rhino Tools Dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rhino-tools-dev?hl=en.