
:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.



== Usage Notes

``Execution``s can be subscribed to using the xref:refguide:applib:index/services/publishing/spi/ExecutionSubscriber.adoc[ExecutionSubscriber] interface.
+
One reason to subscribe is to persist these interaction/executions.
This supports several use cases:

** they enable profiling of the running application (which actions are invoked then most often, what is their response time)

** if auditing is configured (using xref:refguide:applib:index/services/publishing/spi/EntityPropertyChangeSubscriber.adoc[EntityPropertyChangeSubscriber]), they provide better audit information, since the parent xref:refguide:applib:index/services/iactn/Interaction.adoc[Interaction] captures the 'cause' of an interaction and can be correlated to the audit records (the "effect" of the interaction) by way of the xref:applib-classes:mixees-and-mixins.adoc[interactionId] that both share.


== See also

* xref:refguide:applib:index/services/iactn/Interaction.adoc[Interaction]

* xref:refguide:applib:index/services/publishing/spi/ExecutionSubscriber.adoc[ExecutionSubscriber]

* xref:userguide:executionlog:about.adoc[] extension
+
which subscribes to ``Execution``s and simply persists as xref:refguide:extensions:index/executionlog/applib/dom/ExecutionLogEntry.adoc[]s.

* xref:userguide:executionoutbox:about.adoc[] extension
+
which subscribes to ``Execution``s and (similarly) persists as xref:refguide:extensions:index/executionoutbox/applib/dom/ExecutionOutboxEntry.adoc[]s.
However, the outbox extension also provides a REST API which allows outbox entries to be queried and consumed, in other words providing an implementation of the link:https://microservices.io/patterns/data/transactional-outbox.html[Outbox pattern].

