...
Code Block | ||||
---|---|---|---|---|
| ||||
private volatile AepEngine engine; @AppInjectionPoint public void initialize(AepEngine engine) { this.engine = engine; } @EventHandler public void onMessage(BroadcastHostNameRequest message) { InetAddress.getLocalHost().getHostName(); } @EventHandler public void onMessage(SendHostNameCommand command) { BroadcastHostNameResponse response = BroadcastHostNameResponse.create(); response.setHostName(command.getHostName()); send("hostname-response", response); } |
The above technique can be used to
See Scheduling and Injection of Messages for more information.
...
Above we showed how to inject the host name from the local environment into the replication stream, but that has the drawback of creating a new transaction. Talon provides a mechanism to record and tunnel local environment data into the current transactions transaction's replication stream. This feature is called environment replication and allows application developers to write environment providers that record calls into buffers that are serialized for use on the backup so that they can operate on the same data as the primary. With environment replication the above logic would look like:
...