@Test public void onMessageProcessFailure() { final Connector connector = createConnector(); newConnection( connector ); safeAction( () -> connector.setState( ConnectorState.CONNECTED ) ); final Throwable error = new Throwable(); pauseScheduler(); connector.onMessageProcessFailure( error ); assertEquals( connector.getState(), ConnectorState.DISCONNECTING ); }
@Action( verifyRequired = false ) void onMessageProcessFailure( @Nonnull final Throwable error ) { final String message = ReplicantUtil.safeGetString( () -> "Exception processing replicant message." ); ReplicantLogger.log( message, error ); if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy() .reportSpyEvent( new MessageProcessFailureEvent( getSchema().getId(), getSchema().getName(), error ) ); } disconnectIfPossible(); }
Connector extends ReplicantService { @Action( verifyRequired = false ) void onMessageProcessFailure( @Nonnull final Throwable error ) { final String message = ReplicantUtil.safeGetString( () -> "Exception processing replicant message." ); ReplicantLogger.log( message, error ); if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy() .reportSpyEvent( new MessageProcessFailureEvent( getSchema().getId(), getSchema().getName(), error ) ); } disconnectIfPossible(); } }
Connector extends ReplicantService { @Action( verifyRequired = false ) void onMessageProcessFailure( @Nonnull final Throwable error ) { final String message = ReplicantUtil.safeGetString( () -> "Exception processing replicant message." ); ReplicantLogger.log( message, error ); if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy() .reportSpyEvent( new MessageProcessFailureEvent( getSchema().getId(), getSchema().getName(), error ) ); } disconnectIfPossible(); } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); }
Connector extends ReplicantService { @Action( verifyRequired = false ) void onMessageProcessFailure( @Nonnull final Throwable error ) { final String message = ReplicantUtil.safeGetString( () -> "Exception processing replicant message." ); ReplicantLogger.log( message, error ); if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy() .reportSpyEvent( new MessageProcessFailureEvent( getSchema().getId(), getSchema().getName(), error ) ); } disconnectIfPossible(); } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); @Override String toString(); }
Connector extends ReplicantService { @Action( verifyRequired = false ) void onMessageProcessFailure( @Nonnull final Throwable error ) { final String message = ReplicantUtil.safeGetString( () -> "Exception processing replicant message." ); ReplicantLogger.log( message, error ); if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy() .reportSpyEvent( new MessageProcessFailureEvent( getSchema().getId(), getSchema().getName(), error ) ); } disconnectIfPossible(); } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); @Override String toString();  }