= Integration SPI

: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.
:page-partial:

The integration SPIs allow the framework to automate the exchange of data between bounded contexts automatically.

.Integration SPI
[cols="2m,4a",options="header"]
|===

|API
|Description



|xref:refguide:applib:index/services/commanddto/processor/spi/CommandDtoProcessorService.adoc[CommandDtoProcessorService]
|SPI to support representation of commands as XML over REST, in particular to support master/slave replay of commands.




|xref:refguide:applib:index/services/publishing/spi/CommandSubscriber.adoc[CommandSubscriber]
|SPI service to listen on command instances, ie representations of an action invocation or property edit.
Used for command/auditing and background services.

The framework provides a couple of implementations:

* The xref:refguide:applib:index/services/publishing/log/CommandLogger.adoc[CommandLogger] is a trivial implementation that just logs the commands.
* The xref:userguide:commandlog:about.adoc[Command Log] extension is a more complete implementation that persists representation of the commands to a relational database.

|xref:refguide:applib:index/services/publishing/spi/EntityChangesSubscriber.adoc[EntityChangesSubscriber]
|Summarises changes made to entities within an interaction.

The xref:refguide:applib:index/services/publishing/log/EntityChangesLogger.adoc[EntityChangesLogger] is a trivial implementation that just logs the commands.


|xref:refguide:applib:index/services/publishing/spi/EntityPropertyChangeSubscriber.adoc[EntityPropertyChangeSubscriber]
|Publish the changes to all changed properties of all domain object within an interaction.

The xref:refguide:applib:index/services/publishing/log/EntityPropertyChangeLogger.adoc[EntityPropertyChangeLogger] is a trivial implementation that just logs the commands.



|xref:refguide:applib:index/services/publishing/spi/ExecutionSubscriber.adoc[ExecutionSubscriber]
|SPI service to listen on command executions, ie representations of an action invocation or property edit.

The framework provides several implementations:

* The xref:refguide:applib:index/services/publishing/log/ExecutionLogger.adoc[ExecutionLogger] is a trivial implementation that just logs the commands.
* The xref:userguide:executionlog:about.adoc[Execution Log] is a more complete implete implementation that persists an representation of the execution to a relational database.
* The xref:userguide:executionoutbox:about.adoc[Execution Outbox] also implements this SPI, providing an implementation of the "outbox pattern" to allow the publishing of execution events with external "downstream" systems.



|===


