0

Have a sender/pubisher application sending message in multicast channel, and there is another instance Archive recording this message (using startRecording() call)

However, after restart the sender/publisher application. The Archive closed the original recording and recreate a new recording for the same channel automatic.

How to keep the same recording even sender restared? because that recording is used for recovery, with multiple recordings for the same stream make it more complicate to implement.

tried to set autoclose to false in startRecording but doesn't help

[update 2/7/2023] Actually the idea is, we want to have a sender, multiple archive(s) running on multiple server as capture sent message for backup and recovery purpose.

As I understand original sample program only illustrate how capturing side (archive) restart, and using "extendRecording" to keep same recording. But not when capturing side is running, only sender program is restart.

thanks.

Joe
  • 1
  • 1

1 Answers1

1

If you want to use the same recording after the sender has restarted, then you will need to make use of Archive::extendRecording. This provides the ability to resume the same recording. There are a couple of tricky point with this. You will need to make sure that you use the same mtu and set the initial position of the publication correctly.

Michael Barker
  • 14,153
  • 4
  • 48
  • 55
  • The Archive is running on another server/MD from the sender program, do you mean I need to 1) detect sender program/session is stopped, 2) StopRecording(), 3) call extendRecording() to resume on same "recording"? – Joe Feb 07 '23 at 22:50
  • In order to have the recording extended you would need to start the recording in the same process as the publication. Whenever you restart the sender you would need to query the archive to find out the position of the recording. Then use this to start the publication at the correct offset in order to enable the recording to be extended. The sender server can create a remote connection to the archive where the data is going to be stored. – Michael Barker Feb 08 '23 at 00:35
  • actually I tried to set initialPosition in Publication in there sender after restart (using position question from local archive), but remote "Archive" still automate create new recording.... ... umm do you mean when sender program restart, it setup "aeronArchive" to remote "archive" and "extend recording" on it to make sure using the same recording? – Joe Feb 08 '23 at 01:41
  • Yes, that is correct. But to make that work correctly the new publication needs to start with the initial position that matches the stop position of the existing recording. – Michael Barker Feb 08 '23 at 01:43