|
An AEP engine outputs several kinds of trace for tracing and debugging purposes. This document describes the trace outputs emitted by an AEP engine during startup, steady state and shutdown with information on how to control and interpret the output.
An AEP engine's trace is controlled via the nv.aep trace logger. This logger is used by an AEP engine to output flow of exection type of trace messages. The amount of information output by the engine is controlled by the logger's trace level. When using the native logger, the default trace level is INFO. DEBUG is the only additional supported trace level. When using SLF4J, the default trace level is as defined by the concrete SLF4J binding used. The trace levels with SLF4J that control trace output are INFO (corresponding to the native INFO trace level) and TRACE (corresponding to the native DEBUG trace level).
The nv.aep logger is used to output flow of execution trace messages during startup, steady state and shutdown. In steady state, the engine uses additional loggers to log other types of trace messages. They are:
Whether or not the engine emits trace is configured by setting the appropriate property in the app config in DDL. Note that when using SLF4J logging that the trace level must be set to Trace for the corresponding logger.
... <apps> <app name="processor-send-driver" mainClass="com.neeve.embedded_xvm_sample.driver.SendDriver"> <enableEventTrace>true</enableEventTrace> <enableAlertTrace>true</enableAlertTrace> <!--Since 3.11.61--> <enableScheduleTrace>On</enableScheduleTrace> <enableSequenceNumberTrace>On</enableSequenceNumberTrace> <enableTransactionTrace>On</enableTransactionTrace> <enableMessageTrace>true</enableMessageTrace> <messageTraceFilterUnsetFields>true</messageTraceFilterUnsetFields> <messageTraceInJson>true</messageTraceInJson> <messageTraceJsonStyle>SingleLine</messageTraceJsonStyle> <messageTraceMetadataDisplayPolicy>On</messageTraceMetadataDisplayPolicy> ... </app> </apps> ... |
The table below summarize the engine trace level knobs. See DDL Reference for additional details on these knobs. The following sections will discuss the trace output and interpretation in more detail.
Configuration Setting | Description |
---|---|
Enables / disables diagnostic trace logging of events received and dispatched by the engine. | |
Enables / disables diagnostic trace logging of alert events emitted by the engine. | |
Enables / disables diagnostic trace logging of scheduled events. | |
Enables / disables diagnostic trace logging related to message sequencing. | |
Enables / disables diagnostic trace logging of transaction staging. | |
<enableMessageTrace> | Enables / disables message trace |
One of JsonPrettyPrintStyle (Default is SingleLine) | |
One of MetadataDisplayPolicy (Default is Only) | |
true or false, new feature to filter values for fields that aren't set (instead of display their default values) (Default is true) | |
true or false, whether or not to output in json format, setting to false uses a more efficient text based display, but doesn't support single line or unset field filtering (Default is True) |
Since the engine outputs maximal information when started up in debug mode (nv.aep.trace=debug or nv.aep SLF4J logger level set to Trace, we'll talk through a sample startup output of an engine operating in debug mode descibing what different parts of the trace means. Refer to the trace level in the trace output for information what trace messages are output at what levels.
<10,58675,TestMachine> 20130304-17:51:27:102 (dbg)...[AepEngine<forwarder>] Creating engine... <10,58675,TestMachine> 20130304-17:51:27:115 (cfg)... Engine 'forwarder' Configuration { ...channels ......send@aep-perf ......forward@aep-perf ...bus_manager_properties={ ......aep-perf { ......} ...} ...messaging_start_fail_policy='FailIfOneBindingFails' ...message_bus_binding_fail_policy='FailIfAnyBindingFails' ...inbound_message_logging_policy='Default' ...inbound_message_logging_properties={ ...outbound_message_logging_policy='Off' ...outbound_message_logging_properties={ ...message_handling_policy='Normal' ...message_send_policy='SendBeforeReplicate' ...app_exception_handling_policy='QuarantineAndStop' ...message_send_exception_handling_policy='TreatAsStabilityFailure' ...event_multiplexer_type='DedicatedThreaded' ...event_multiplexer_properties={ ...} ...adaptive_commit_batch_ceiling=0 ...dispatch_transaction_stage_events=false ...enable_transaction_commit_suspension=false ...replicate_unsolicited_sends=false ...sequence_unsolicited_sends=false ...sequence_unsolicited_with_solicited_sends=false ...quarantine_channel=null ...quarantine_message_key=null ...ha_policy='EventSourcing' ...replication_policy='Asynchronous' ...store='forwarder' } Store 'forwarder' Configuration { ...provider={Address=., Provider=native} ...persister='forwarder' ...persistenceQuorum=2 ...maxPersistSyncBacklog=5 ...failOnMultiplePrimaries=false } Store Persister 'forwarder' Configuration { ...class='com.neeve.rog.persist.RogPersister' ...properties { ......MainClass=com.neeve.rog.persist.RogPersister ...} <10,58675,TestMachine> 20130304-17:51:27:116 (dbg)...[AepEngine<forwarder>] Loaded engine store 'forwarder'. <10,58675,TestMachine> 20130304-17:51:27:116 (dbg)...[AepEngine<forwarder>] Loaded bus 'aep-perf'. <10,58675,TestMachine> 20130304-17:51:27:126 (dbg)...[AepEngine<forwarder>] Initializing channel keys in outbound messaging context... <10,58675,TestMachine> 20130304-17:51:27:129 (dbg)...[AepEngine<forwarder>] ...[channel=send, key=null, parts=0] <10,58675,TestMachine> 20130304-17:51:27:129 (dbg)...[AepEngine<forwarder>] ...[channel=forward, key=null, parts=0] <10,58675,TestMachine> 20130304-17:51:27:150 (dbg)...[AepEngine<forwarder>] Engine created successfully. <10,58675,TestMachine> 20130304-17:51:27:150 (dbg)...[AepEngine<forwarder>] Starting engine 'forwarder'... <10,58675,TestMachine> 20130304-17:51:27:347 (dbg)...[AepEngine<forwarder>] created engine store 'forwarder' (member id='null'). <10,58675,TestMachine> 20130304-17:51:27:347 (dbg)...[AepEngine<forwarder>] Initializing inbound message logger... <10,58675,TestMachine> 20130304-17:51:27:348 (dbg)...[AepEngine<forwarder>] ...using store persister for inbound message logging <10,58675,TestMachine> 20130304-17:51:27:348 (dbg)...[AepEngine<forwarder>] Initializing outbound message logger... <10,58675,TestMachine> 20130304-17:51:27:348 (dbg)...[AepEngine<forwarder>] ...outbound message logging is off (configured to be Off) <10,58675,TestMachine> 20130304-17:51:27:367 (inf)...[McastDiscoveryCache-17150379-8672-4ccf-ae09-df35326aeafb] Using network interface [ham0,</2620:9b:0:0:0:0:1934:7370,/fe80:0:0:0:7879:19ff:fe34:7370%8,/25.52.115.112>]. <11,58675,TestMachine> 20130304-17:51:37:491 (inf)...[StorePersister->'forwarder'] Not writing factories (Factories file already exists). <10,58675,TestMachine> 20130304-17:51:37:593 (inf)...[StorePersister->'forwarder'] Materialized 100 objects from recovery log. <10,58675,TestMachine> 20130304-17:51:37:594 (dbg)...[AepEngine<forwarder>] Opened engine store. <10,58675,TestMachine> 20130304-17:51:37:595 (dbg)...[AepEngine<forwarder>] Created new flow collection (initial store=null). <10,58675,TestMachine> 20130304-17:51:37:595 (dbg)...[AepEngine<forwarder>] Engine is Primary <10,58675,TestMachine> 20130304-17:51:37:595 (dbg)...[AepEngine<forwarder>] Starting messaging... <10,58675,TestMachine> 20130304-17:51:37:596 (dbg)...[AepEngine<forwarder>] Skipping default bus descriptor (no 'server' messaging provider). <10,58675,TestMachine> 20130304-17:51:37:599 (dbg)...[AepEngine<forwarder>] Creating outbound queue for bus manager 'forwarder.aep-perf... <10,58675,TestMachine> 20130304-17:51:37:601 (dbg)...[AepEngine<forwarder>] ...operating in attached mode (foreground sends)... <10,58675,TestMachine> 20130304-17:51:37:768 (dbg)...[AepEngine<forwarder>] Opened bus 'aep-perf' (provider='jms') <10,58675,TestMachine> 20130304-17:51:37:778 (dbg)...[AepEngine<forwarder>] ...channel 'send' (join=true)...ok. <10,58675,TestMachine> 20130304-17:51:37:779 (dbg)...[AepEngine<forwarder>] ...channel 'forward' (join=false)...ok. <12,58675,TestMachine> 20130304-17:51:37:786 (dbg)...[AepEngine<forwarder>] Received an event (event=[event=CHANNEL UP, type=504, source=aep-perf, owners=2, endOfBatch=false, channel=com.neeve.jms.JmsMessageChannel@1389c036]) <10,58675,TestMachine> 20130304-17:51:37:786 (inf)...[AepEngine<forwarder>] Engine started [Clustered, Primary]. Waiting for messaging to start... <12,58675,TestMachine> 20130304-17:51:37:786 (dbg)...[AepEngine<forwarder>] Passing event (type=AepChannelUpEvent<504>) through to application... <12,58675,TestMachine> 20130304-17:51:37:786 (dbg)...[AepEngine<forwarder>] Event processing is complete. <12,58675,TestMachine> 20130304-17:51:37:786 (dbg)...[AepEngine<forwarder>] Received an event (event=[event=CHANNEL UP, type=504, source=aep-perf, owners=2, endOfBatch=true, channel=com.neeve.jms.JmsMessageChannel@38aa233f]) <12,58675,TestMachine> 20130304-17:51:37:786 (dbg)...[AepEngine<forwarder>] Passing event (type=AepChannelUpEvent<504>) through to application... <12,58675,TestMachine> 20130304-17:51:37:786 (dbg)...[AepEngine<forwarder>] Event processing is complete. <12,58675,TestMachine> 20130304-17:51:37:786 (dbg)...[AepEngine<forwarder>] Received an event (event=[event=BUS BINDING UP, type=511, source=aep-perf, owners=2, endOfBatch=false, binding=aep-perf]) <12,58675,TestMachine> 20130304-17:51:37:786 (dbg)...[AepEngine<forwarder>] Passing event (type=AepBusBindingUpEvent<511>) through to application... <12,58675,TestMachine> 20130304-17:51:37:786 (dbg)...[AepEngine<forwarder>] Event processing is complete. <12,58675,TestMachine> 20130304-17:51:37:787 (dbg)...[AepEngine<forwarder>] Received an event (event=[event=MESSAGING_STARTED, type=509, source=null, status=null]) <12,58675,TestMachine> 20130304-17:51:37:787 (dbg)...[AepEngine<forwarder>] Completing messaging start... <12,58675,TestMachine> 20130304-17:51:37:787 (dbg)...[AepEngine<forwarder>] Passing event (type=AepMessagingPrestartEvent<517>) through to application... <12,58675,TestMachine> 20130304-17:51:37:787 (dbg)...[AepEngine<forwarder>] Event processing is complete. <12,58675,TestMachine> 20130304-17:51:37:788 (dbg)...[AepEngine<forwarder>] Passing event (type=AepMessagingStartedEvent<509>) through to application... <12,58675,TestMachine> 20130304-17:51:37:788 (dbg)...[AepEngine<forwarder>] Event processing is complete. Receiving and forwarding messages... <12,58675,TestMachine> 20130304-17:51:37:788 (dbg)...[AepEngine<forwarder>] Committing current transaction (#1)... <12,58675,TestMachine> 20130304-17:51:37:788 (dbg)...[AepEngine<forwarder>] Committing event instruction pointers... <12,58675,TestMachine> 20130304-17:51:37:788 (dbg)...[AepEngine<forwarder>] ...no flows in transaction. <12,58675,TestMachine> 20130304-17:51:37:788 (dbg)...[AepEngine<forwarder>] Committing outbound messages... <12,58675,TestMachine> 20130304-17:51:37:789 (dbg)...[AepEngine<forwarder>] No outbound messages to commit. <12,58675,TestMachine> 20130304-17:51:37:789 (dbg)...[AepEngine<forwarder>] All send commits are complete (txn #1). <12,58675,TestMachine> 20130304-17:51:37:789 (dbg)...[AepEngine<forwarder>] ...in-out latency not calculated. <12,58675,TestMachine> 20130304-17:51:37:789 (dbg)...[AepEngine<forwarder>] Replicating inbound messages... <12,58675,TestMachine> 20130304-17:51:37:789 (dbg)...[AepEngine<forwarder>] Replicated 0 messages. <12,58675,TestMachine> 20130304-17:51:37:789 (dbg)...[AepEngine<forwarder>] Committing store... <12,58675,TestMachine> 20130304-17:51:37:789 (dbg)...[AepEngine<forwarder>] Store commit is complete (txn #1). <12,58675,TestMachine> 20130304-17:51:37:789 (dbg)...[AepEngine<forwarder>] Logging outbound messages... <12,58675,TestMachine> 20130304-17:51:37:789 (dbg)...[AepEngine<forwarder>] ...outbound message logging is not enabled <12,58675,TestMachine> 20130304-17:51:37:789 (dbg)...[AepEngine<forwarder>] Transaction #1 is complete. <12,58675,TestMachine> 20130304-17:51:37:789 (dbg)...[AepEngine<forwarder>] ...in-ack latency not calculated. |
The following pertains is outbound during engine creation i.e. when the engine initializes itself prior to start.
<10,58675,TestMachine> 20130304-17:51:27:102 (dbg)...[AepEngine<forwarder>] Creating engine... |
All engine creation related output is bracketed between the "Creating engine…"and "Engine created successfully" trace messages. The first part of the output contains the engine configuration (which the engine outputs at the CONFIG trace level (INFO for SLF4J)). The remainder of the trace relates to the engine initializing its internal data structures from various descriptors (bus, store, persister, etc) that it loads from platform configuration repository.
An AEP engine goes through the following steps during startup:
Note: A standalone engine (engine not configured to run in clustered mode) does not open an ODS store. Therefore, steps 3, 4a and 5 do not apply to such engines.
All engine startup related output is bracketed between the "Starting engine…"and "Engine started successfully…" trace messages. Engine startup trace is composed of trace related to each of the steps outlined above. The following extracts pertain to each of the steps above:
<10,58675,TestMachine> 20130304-17:51:27:347 (dbg)...[AepEngine<forwarder>] Initializing inbound message logger... <10,58675,TestMachine> 20130304-17:51:27:348 (dbg)...[AepEngine<forwarder>] ...using store persister for inbound message logging <10,58675,TestMachine> 20130304-17:51:27:348 (dbg)...[AepEngine<forwarder>] Initializing outbound message logger... <10,58675,TestMachine> 20130304-17:51:27:348 (dbg)...[AepEngine<forwarder>] ...outbound message logging is off (configured to be Off) |
The trace related to message log creation describes how the engine parses the configured inbound and outbound message logging policies and how it goes about processing them. In the engine that outputs the above trace, the store persister is configured for use as the inbound logger (default for clustered event-sourced engine) and is not configured for outbound message logging.
<10,58675,TestMachine> 20130304-17:51:27:367 (inf)...[McastDiscoveryCache-17150379-8672-4ccf-ae09-df35326aeafb] Using network interface [ham0,</2620:9b:0:0:0:0:1934:7370,/fe80:0:0:0:7879:19ff:fe34:7370%8,/25.52.115.112>]. |
The next step is to join the discovery network using the discovery descriptor configured for the engine. The discovery protocol is used by an engine to discover peer agents. The engine that output the trace above was configured to use UDP based discovery to advertize itself and discover other cluster agents.
While the above trace statement represents steps 3a and 3b in the steps outlined above, role election is performed by the engine's ODS store subsequent to joining the discovery network using the information gleaned from the discovery process There is no trace information output by the AEP engine related to the role election process and, therefore, does not appear in the above output. All role election related trace is output by the engine's ODS store with nv.ods logger's trace level set at verbose or above i.e. nv.ods.trace=verbose/debug or the nv.ods SLF4J logger level at DEBUG or TRACE.
The next step after role election is to initialize application state from the application's recovery log. A primary agent initializes state from its recovery log while a backup agent initializes its state from the cluster primary's recovery log. The following is sample trace for the various initialization scenarios (the trace above was performed by a primary event-sourced engine that initialized its state by 100 messages in the recovery log):
<11,58675,TestMachine> 20130304-17:51:37:491 (inf)...[StorePersister->'forwarder'] Writing factories... <10,58675,TestMachine> 20130304-17:51:37:593 (inf)...[StorePersister->'forwarder'] Materialized 0 objects from recovery log. |
An engine's automatically creates its recovery log if not found on startup (if configured for persistence). The recovery log is accompanied by a factories file that is also created when the log is created. The factories file is created when the log is created and contains the set of factories registered in the X runtime at the time the factories. The above trace indicates that a new factories file and no entries were found in the recovery log to recover from. Together, they indicate that a new recovery log was created.
<11,58675,TestMachine> 20130304-17:51:37:491 (inf)...[StorePersister->'forwarder'] Not writing factories (Factories file already exists). <10,58675,TestMachine> 20130304-17:51:37:593 (inf)...[StorePersister->'forwarder'] Materialized 100 objects from recovery log. |
The above trace is output by a primary engine whose recovery log is already present at startup. The trace messages output how many messages were recovered from the recovery log to initialize the application state. The above engine recovered 100 messages from the log to reinitiaize its state.
<11,58675,TestMachine> 20130304-17:51:37:491 (inf)...[StorePersister->'forwarder'] Backing up recovery log... <11,58675,TestMachine> 20130304-17:51:37:491 (inf)...[StorePersister->'forwarder'] ...no log to back up. <11,58675,TestMachine> 20130304-17:51:37:491 (inf)...[StorePersister->'forwarder'] Writing factories... |
After being elected a backup, an engine first backs up its recovery log if it exists before it initializes its state from the cluster primary since the state initialization process will write the primary's state to the backup's log. The above output is emit by a backup that is being started fresh i.e. a backup agent that does not have a recovery log from a previous run.
<11,58675,TestMachine> 20130304-17:51:37:491 (inf)...[StorePersister->'forwarder'] Backing up recovery log... <11,58675,TestMachine> 20130304-17:51:37:491 (inf)...[StorePersister->'forwarder'] ... backed up log to '/home/nvx/rdat/forwarder.log.2013-03-04-19-17-00'. <11,58675,TestMachine> 20130304-17:51:37:491 (inf)...[StorePersister->'forwarder'] Not writing factories (Factories file already exists)... |
The above output is emit by a backup that has been restarted.
For a primary engine, the completion of the log recovery is indicated by the "…Materialized xxx objects from recovery log." trace entry.
For a backup engine, the completion of the log recovery is indicated by the dispatch of a StoreMemberInitCompleteEvent event. This event is dispatched by an engine when it's initialization from the primary has completed i.e. the backup has completed joining the cluster. The following extract from a backup's log reflects the dispatch of the init completion event.
<11,58675,TestMachine> 20130304-17:51:37:491 (inf)...[StorePersister->'forwarder'] Received an event (event=type=305, source=28d6a45a-a71a-4bac-9aeb-c26ec442f200, owners=1, endOfBatch=true) <11,58675,TestMachine> 20130304-17:51:37:491 (inf)...[StorePersister->'forwarder'] ... Passing event (type=StoreMemberInitCompleteEvent<305>) through to application... <11,58675,TestMachine> 20130304-17:51:37:491 (inf)...[StorePersister->'forwarder'] Event processing is complete. |
Once role election and application initialization is complete, the engine starts the messaging machinery only if elected as primary. If elected as a backup, the engine goes into standby mode operating per its function as a backup member of an event sourced or state replicated cluster as the case may be. Therefore, strictly speaking, the completion of application initialization marks the completion of engine startup. For a primary engine, the starting of messaging happens immediately after engine startup while, for backup engines, messaging is started only after the primary fails and the backup is elected the new primary in the cluster. For the purpose of understanding the contents of the logs, one application initialization is complete, the entries in the log relating to the completion of the startup and starting messaging should be considered to be executing concurrently.
The following trace extract from above describes the successful starting of messaging by an agent elected as primary:
<10,58675,TestMachine> 20130304-17:51:37:595 (dbg)...[AepEngine<forwarder>] Engine is Primary <10,58675,TestMachine> 20130304-17:51:37:595 (dbg)...[AepEngine<forwarder>] Starting messaging... <10,58675,TestMachine> 20130304-17:51:37:596 (dbg)...[AepEngine<forwarder>] Skipping default bus descriptor (no 'server' messaging provider). <10,58675,TestMachine> 20130304-17:51:37:599 (dbg)...[AepEngine<forwarder>] Creating outbound queue for bus manager 'forwarder.aep-perf... <10,58675,TestMachine> 20130304-17:51:37:601 (dbg)...[AepEngine<forwarder>] ...operating in attached mode (foreground sends)... <10,58675,TestMachine> 20130304-17:51:37:768 (dbg)...[AepEngine<forwarder>] Opened bus 'aep-perf' (provider='jms') <10,58675,TestMachine> 20130304-17:51:37:778 (dbg)...[AepEngine<forwarder>] ...channel 'send' (join=true)...ok. <10,58675,TestMachine> 20130304-17:51:37:779 (dbg)...[AepEngine<forwarder>] ...channel 'forward' (join=false)...ok. <12,58675,TestMachine> 20130304-17:51:37:786 (dbg)...[AepEngine<forwarder>] Received an event (event=[event=CHANNEL UP, type=504, source=aep-perf, owners=2, endOfBatch=false, channel=com.neeve.jms.JmsMessageChannel@1389c036]) <10,58675,TestMachine> 20130304-17:51:37:786 (inf)...[AepEngine<forwarder>] Engine started [Clustered, Primary]. Waiting for messaging to start... <12,58675,TestMachine> 20130304-17:51:37:786 (dbg)...[AepEngine<forwarder>] Passing event (type=AepChannelUpEvent<504>) through to application... <12,58675,TestMachine> 20130304-17:51:37:786 (dbg)...[AepEngine<forwarder>] Event processing is complete. <12,58675,TestMachine> 20130304-17:51:37:786 (dbg)...[AepEngine<forwarder>] Received an event (event=[event=CHANNEL UP, type=504, source=aep-perf, owners=2, endOfBatch=true, channel=com.neeve.jms.JmsMessageChannel@38aa233f]) <12,58675,TestMachine> 20130304-17:51:37:786 (dbg)...[AepEngine<forwarder>] Passing event (type=AepChannelUpEvent<504>) through to application... <12,58675,TestMachine> 20130304-17:51:37:786 (dbg)...[AepEngine<forwarder>] Event processing is complete. <12,58675,TestMachine> 20130304-17:51:37:786 (dbg)...[AepEngine<forwarder>] Received an event (event=[event=BUS BINDING UP, type=511, source=aep-perf, owners=2, endOfBatch=false, binding=aep-perf]) <12,58675,TestMachine> 20130304-17:51:37:786 (dbg)...[AepEngine<forwarder>] Passing event (type=AepBusBindingUpEvent<511>) through to application... <12,58675,TestMachine> 20130304-17:51:37:786 (dbg)...[AepEngine<forwarder>] Event processing is complete. <12,58675,TestMachine> 20130304-17:51:37:787 (dbg)...[AepEngine<forwarder>] Received an event (event=[event=MESSAGING_STARTED, type=509, source=null, status=null]) <12,58675,TestMachine> 20130304-17:51:37:787 (dbg)...[AepEngine<forwarder>] Completing messaging start... <12,58675,TestMachine> 20130304-17:51:37:787 (dbg)...[AepEngine<forwarder>] Passing event (type=AepMessagingPrestartEvent<517>) through to application... <12,58675,TestMachine> 20130304-17:51:37:787 (dbg)...[AepEngine<forwarder>] Event processing is complete. <12,58675,TestMachine> 20130304-17:51:37:788 (dbg)...[AepEngine<forwarder>] Passing event (type=AepMessagingStartedEvent<509>) through to application... <12,58675,TestMachine> 20130304-17:51:37:788 (dbg)...[AepEngine<forwarder>] Event processing is complete. |
Once a primary agent has completed the application initialization, it immediately kicks off the start of the messaging machinery. The trace related to the starting of the messaging starts with the statement of the engine's state and ends with the dispatch of the 'messaging started' event to the application. The trace essentially comprises of the following:
See the AEP Events documents for more details on these events.
The highligted portion above indicates the completion of initialization. If initialization fails, the highlighted message will not be output replaced by a corresponding message indicating start failure is output. The key point here is that a messaging start failure (as deemed by the MessagingStartFailPolicy) is not interpreted by the engine as a start failure. In the event that messaging fails to start, the above highlighted message will still be output. If the failures encountered during the starting of messaging - one or more messaging bindings (connections) failing to open – alongwith the start fail policy resolve in messaging deemed to have failed, then the engine will immediately trigger the engine's stop machinery. However, the above highlighted message will still be displayed. See the next section where this is illustrated.
The following trace extract illustrates the failed starting of messaging by an agent elected as primary. Note the highlighted portion that illusrrates the point made in the previous section.
<10,60449,TestMachine> 20130304-20:01:40:909 (dbg)...[AepEngine<forwarder>] Engine is Primary <10,60449,TestMachine> 20130304-20:01:40:909 (dbg)...[AepEngine<forwarder>] Starting messaging... <10,60449,TestMachine> 20130304-20:01:41:608 (wrn)...[AepEngine<forwarder>] Failed (temporary) to open bus 'aep-perf' (provider='jms') [javax.jms.JMSException: Failed to connect to the server at localhost:7223] <10,60449,TestMachine> 20130304-20:01:41:609 (inf)...[AepEngine<forwarder>] Engine started [Clustered, Primary]. Waiting for messaging to start... <12,60449,TestMachine> 20130304-20:01:41:609 (dbg)...[AepEngine<forwarder>] Received an event (event=[event=MESSAGING_STARTED, type=509, source=null, status=javax.jms.JMSException: Failed to connect to the server at localhost:7223]) <12,60449,TestMachine> 20130304-20:01:41:609 (dbg)...[AepEngine<forwarder>] Completing messaging start... <12,60449,TestMachine> 20130304-20:01:41:611 (dbg)...[AepEngine<forwarder>] Passing event (type=AepMessagingStartedEvent<509>) through to application... <12,60449,TestMachine> 20130304-20:01:41:611 (dbg)...[AepEngine<forwarder>] Event processing is complete. <12,60449,TestMachine> 20130304-20:01:41:611 (dbg)...[AepEngine<forwarder>] Stopping engine 'forwarder' (cause=com.neeve.aep.EAepException: javax.jms.JMSException: Failed to connect to the server at localhost:7223)... <12,60449,TestMachine> 20130304-20:01:41:612 (dbg)...[AepEngine<forwarder>] Scheduling stop... <12,60449,TestMachine> 20130304-20:01:41:612 (dbg)...[AepEngine<forwarder>] Stopping engine 'forwarder' (cause=com.neeve.aep.EAepException: javax.jms.JMSException: Failed to connect to the server at localhost:7223)... <12,60449,TestMachine> 20130304-20:01:41:612 (dbg)...[AepEngine<forwarder>] ...not waiting for stop to complete... <12,60449,TestMachine> 20130304-20:01:41:612 (dbg)...[AepEngine<forwarder>] Committing current transaction (#1)... <10,60449,TestMachine> 20130304-20:01:41:612 (dbg)...[AepEngine<forwarder>] Stopping engine 'forwarder' (cause=com.neeve.aep.EAepException: javax.jms.JMSException: Failed to connect to the server at localhost:7223)... <10,60449,TestMachine> 20130304-20:01:41:612 (dbg)...[AepEngine<forwarder>] Waiting for stop to complete... |
The following is the corresponding trace output by an agent elected as backup:
<10,58675,TestMachine> 20130304-17:51:37:595 (dbg)...[AepEngine<forwarder>] Engine is Backup <10,58675,TestMachine> 20130304-17:51:37:595 (dbg)...[AepEngine<forwarder>] Engine started [Clustered, Backup]. |
Once the agent takes over as primary, the output is similar to the above (see Failover section below).
By default, when operating in steady state, an AEP engine only outputs warning/error messages and no informational messages. However, the engine can be configured to emit the following types of trace messages:
Switching on debug flow of execution trace during steady state produces a lot of output.
The sequence number trace outputs sequence numbers of inbound and outbound messages. The following is an example of the sequence number trace output.
<11,62355,TestMachine> 20130304-23:59:15:429 (dbg)...<-- [-905962955, 0, 0, 0] OK <11,62355,TestMachine> 20130304-23:59:15:429 (dbg)...--> [2097807922, 86] |
Sequence number trace records are output at different stages in the processing of messages. They are:
<11,62355,TestMachine> 20130304-23:59:15:429 (dbg)...<-- [-905962955, 42, 1, 36] OK
The above trace message indicates that a message wth sequence number #42 was received from sender on flow #1, the message being #36 on that flow and it passed the duplicate checks (indicated by OK). This trace message essentially indicates a successful receipt of the message by the engine for processing.
<11,62355,TestMachine> 20130304-23:59:15:429 (dbg)...<-- [-905962955, 42, 1, 36] DUP |
The above trace message indicates that a message wth sequence number #42 was received from sender -905962955 on flow #1, the message being #36 on that flow but it did not pass the duplicate checks (indicated by DUP). Not passing the duplicate check implies that a message with the same sequence number has already been processed from the sender. Such a situation should really never happen in steady state but is normal to happen initiallt after a failover when in-doubt messages retransmitted by the messaging subsystem are filtered by new primary.
These trace messages can only be output if duplicate checking is enabled on an engine (default=true).
<11,62355,TestMachine> 20130304-23:59:15:429 (dbg)...--> [2097807922, 84] |
The above trace message is output when a message is sent by a primary in response to an inbound message i.e. 'solicited' send. Unsolicited sends do not output the above trace.
<11,62355,TestMachine> 20130304-23:59:15:429 (dbg)...--> [2097807922, 84] Q |
The above trace message can only be output by a backup agent running in an event-sourced cluster configured for ReplicateBeforeSend. In such a configuration, the backup processes inbound messages in parallel with the primary (driven by replication traffic governed by the primary). Messages sent outbound as part of the processing inbound messages are enqueued in an outbound queue on the backup. Sequence number trace messages are output when outbound messages are enqueued in the backup's outbound message queue. For example, the above trace message indicates that message #84 from sender 2097807922 was enqueued in the backup's outbound queue.
<11,62355,TestMachine> 20130304-23:59:15:429 (dbg)...<-- [2097807922, 84] QX |
The above trace message can only be output by a backup agent running in an event-sourced cluster configured for ReplicateBeforeSend. Messages enqueued in a backup's outbound queue are removed when the ACK for the message is successfully received by the backup. The primary replicates such information in the replication header at which point the messages are pruned from the backup's outbound queue. The above is an example output when message #84 from sender 2097807922 was pruned from the backup's outbound queue.
Note: For outbound messages, the sender id is the sending id of the engine outputting the trace.
<11,62355,TestMachine> 20130304-23:59:15:429 (dbg)...--> [2097807922, 84] Q |
The above trace message can only be output by a backup agent running in an event-sourced cluster configured for SendBeforeReplicate. In such a configuration, the backup processes inbound messages in parallel with the primary (driven by replication traffic governed by the primary). However, messages sent by the backup are not enqueued in the backup but rather discarded.
<11,62355,TestMachine> 20130304-23:59:15:429 (dbg)...--> [-905962955, 42] ACK |
The above trace message is outbound when an inbiund message is considered stable and is acknowledged upstream. In the above trace output, the message swith sequence numbr #42 was successfully acknowledged upstream.
<11,62355,TestMachine> 20130304-23:59:15:429 (dbg)...--> [2097807922, 84] R |
The above trace message can only be output by a backup agent running in an event-sourced cluster configured for ReplicateBeforeSend. On failover, the primary re-transmits all outbound messages in its backup outbound queue. For example, the above trace indicates that message #84 was not acknolwedged by the primary and is retansmitted on a failover.
The event trace outputs events received by the AEP engine for processing. The following is an example outout of event dispatch trace:
<10,63098,TestMachine> 20130305-00:51:23:037 (dbg)...<-- [AepChannelUpEvent<504>] |
Where the line starting with "<—" indicates that the the event was picked up by the engine's multiplexer thread, and the line starting with "<D>" indicates that the event was dispatch to registered application EventHandlers (note that not all events processed by an engine are forwarded on to application handlers).
Waiting for messaging to start...
<10,63098,TestMachine> 20130305-00:51:23:039 (dbg)...<-- [AepChannelUpEvent<504>] <10,63098,TestMachine> 20130305-00:51:23:039 (dbg)...<-- [AepBusBindingUpEvent<511>] <10,63098,TestMachine> 20130305-00:51:23:039 (dbg)...<-- [AepMessagingStartedEvent<509>] |
Receiving and forwarding messages...
<10,63098,TestMachine> 20130305-00:51:32:155 (dbg)...<-- [StoreMemberUpEvent<304>] <10,63098,TestMachine> 20130305-00:51:32:164 (dbg)...<-- [StoreMemberInitCompleteEvent<305>] <10,63098,TestMachine> 20130305-00:51:47:628 (dbg)...<-- [MessageEvent<105>] <10,63098,TestMachine> 20130305-00:51:47:657 (dbg)...<-- [MessageEvent<105>] |
Each event trace message contains the name of the event dispatched to the engine. This trace is particularly useful when combined with the sequence number tracer.
The event trace is output by both the primary and backup.
The transaction execution trace outputs events each indicating an execution step in the engine's transaction workflow. The following is an example of transaction execution trace:
<11,63190,TestMachine> 20130305-00:57:24:500 (dbg)...Txn #1..doSendComplete <11,63190,TestMachine> 20130305-00:57:24:500 (dbg)...Txn #1..doInboundMessageReplicate <11,63190,TestMachine> 20130305-00:57:24:500 (dbg)...Txn #1..doStoreCommit <11,63190,TestMachine> 20130305-00:57:24:500 (dbg)...Txn #1..onStoreCommitComplete <11,63190,TestMachine> 20130305-00:57:24:501 (dbg)...Txn #1..onStoreCommitCompleteOrdered <11,63190,TestMachine> 20130305-00:57:24:501 (dbg)...Txn #1..doSendCommit <11,63190,TestMachine> 20130305-00:57:24:501 (dbg)...Txn #1..onSendCommitComplete <11,63190,TestMachine> 20130305-00:57:24:501 (dbg)...Txn #1..onSendCommitCompleteOrdered <11,63190,TestMachine> 20130305-00:57:24:501 (dbg)...Txn #1..doOutboundMessageLogging <11,63190,TestMachine> 20130305-00:57:24:501 (dbg)...Txn #1..onOutboundMessageLoggingComplete <11,63190,TestMachine> 20130305-00:57:24:501 (dbg)...Txn #1..CommitComplete <11,63190,TestMachine> 20130305-00:58:41:450 (dbg)...Txn #2..Commit <11,63190,TestMachine> 20130305-00:58:41:450 (dbg)...Txn #2..doSendComplete <11,63190,TestMachine> 20130305-00:58:41:450 (dbg)...Txn #2..doInboundMessageReplicate <11,63190,TestMachine> 20130305-00:58:41:450 (dbg)...Txn #2..doStoreCommit <11,63190,TestMachine> 20130305-00:58:41:453 (dbg)...Txn #2..onStoreCommitComplete <11,63190,TestMachine> 20130305-00:58:41:453 (dbg)...Txn #2..onStoreCommitCompleteOrdered <11,63190,TestMachine> 20130305-00:58:41:453 (dbg)...Txn #2..doSendCommit <11,63190,TestMachine> 20130305-00:58:41:454 (dbg)...Txn #3..Commit <11,63190,TestMachine> 20130305-00:58:41:454 (dbg)...Txn #3..doSendComplete <11,63190,TestMachine> 20130305-00:58:41:454 (dbg)...Txn #3..doInboundMessageReplicate <11,63190,TestMachine> 20130305-00:58:41:455 (dbg)...Txn #3..doStoreCommit <11,63190,TestMachine> 20130305-00:58:41:455 (dbg)...Txn #3..onStoreCommitComplete <11,63190,TestMachine> 20130305-00:58:41:455 (dbg)...Txn #3..onStoreCommitCompleteOrdered <11,63190,TestMachine> 20130305-00:58:41:455 (dbg)...Txn #3..doSendCommit <11,63190,TestMachine> 20130305-00:58:41:455 (dbg)...Txn #4..Commit <11,63190,TestMachine> 20130305-00:58:41:455 (dbg)...Txn #4..doSendComplete <11,63190,TestMachine> 20130305-00:58:41:455 (dbg)...Txn #4..doInboundMessageReplicate <11,63190,TestMachine> 20130305-00:58:41:456 (dbg)...Txn #4..doStoreCommit <11,63190,TestMachine> 20130305-00:58:41:456 (dbg)...Txn #4..onStoreCommitComplete <11,63190,TestMachine> 20130305-00:58:41:456 (dbg)...Txn #4..onStoreCommitCompleteOrdered <11,63190,TestMachine> 20130305-00:58:41:456 (dbg)...Txn #4..doSendCommit |
Transaction execution trace is not output by a backup agent.
Alert trace traces any event implement IAlertEvent to the nv.aep.alert logger. For example, an UnhandleMessageEvent emitted because no MessageView factory could be found, would yield trace like:
<13,343452,TestMachine> 20190314-15:24:13:533 (wrn)...[AepEngine<sma-tck-forwarder>] [ALERT]: [event=UNHANDLED_MESSAGE, type=111, source=sma-tck-forwarder, owners=2, endOfBatch=true, delay=0, scheduledTime=0, dispatchTime=0, time=1552602253523, metadata=[2,3,2300,1,0,0,0,-1,F_BE_1], key=F_BE_1, messageId='18', reason=com.neeve.sma.SmaException: Fault in handling of inbound message by channel [id=18, topic=F_BE_1]: View factory '2300' could not be found] |
Unlike other AepEngine loggers, alert trace is enabled by default. This is because under normal usage patterns alerts are almost always indicative of a problem. Application's that want finer grain control over logging of alert logging can disable alert trace and provide their own EventHandler for IAlertEvent.
See Tracing Messages
The following is the trace (with nv.aep.trace=debug) of a backup that was elected primary on failover
<11,64674,TestMachine> 20130305-03:21:09:176 (dbg)...[AepEngine<forwarder>] Engine is Primary |
The trace above is divided into two parts. The first part from "Engine is Primary" to the completion of the dispatch of the messaging started event is very similar to the trace of the primary engine starting messaging during startup. The part after that i.e.between the bold text is where the backup agent restransmits messages in its backup outbound queue on failover. In the above case only a single message was retransmitted. However, more than one message could be retransmitted. The retransmitted messages are transmitted using sequence numbers at the point at which the primary left off.
|
The trace output by an engine during shutdown is relatively standard and does not warrant special explanation.
Some documentation goes here.
The nv.aep.event logger that traces events dispatched to an engine