Skip to content

Commit

Permalink
Polished
Browse files Browse the repository at this point in the history
  • Loading branch information
davsclaus committed Mar 17, 2018
1 parent 8a37b13 commit a39733e
Show file tree
Hide file tree
Showing 13 changed files with 200 additions and 15 deletions.
16 changes: 8 additions & 8 deletions camel-core/src/main/docs/eips/saga-eip.adoc
Expand Up @@ -41,10 +41,10 @@ The Saga EIP supports 6 options which are listed below:
The following properties are set on each Exchange that is participating to a Saga (normal actions, compensating actions and completions):

[width="100%",cols="4m,2m,5",options="header"]
|=======================================================================
|===
| Property | Type | Description
| `Long-Running-Action` | `String` | A globally unique identifier for the Saga that can be propagated to remote systems using transport-level headers (e.g. HTTP).
|=======================================================================
|===

=== Saga Service Configuration
The Saga EIP requires that a service implementing the interface `org.apache.camel.saga.CamelSagaService` is added to the Camel context.
Expand Down Expand Up @@ -120,9 +120,9 @@ sagaService.setLocalParticipantUrl("http://my-host-as-seen-by-lra-service:8080/c
context.addService(sagaService);
----

===== Using the LRA Saga Service in Spring-Boot
===== Using the LRA Saga Service in Spring Boot

Spring-Boot users can use a simplified configuration model for the LRA Saga Service. Maven users can
Spring Boot users can use a simplified configuration model for the LRA Saga Service. Maven users can
include the *camel-lra-starter* module in their project:

[source,xml]
Expand All @@ -142,7 +142,7 @@ include the *camel-lra-starter* module in their project:
</dependency>
----

Configuration can be done in the Spring-Boot `application.yaml` file:
Configuration can be done in the Spring Boot `application.yaml` file:

.application.yaml
[source,yaml]
Expand Down Expand Up @@ -333,7 +333,7 @@ Since the _direct:creditReservation_ endpoint can be now called also from outsid
Sagas are long running actions, but this does not mean that they should not have a bounded timeframe to execute.
*Setting timeouts on Sagas is always a good practice* as it guarantees that a Saga does not remain stuck forever in the case of machine failure.

NOTE: the Saga EIP implementation may have a default timeout set on all Sagas that don't specify it explicitly
NOTE: The Saga EIP implementation may have a default timeout set on all Sagas that don't specify it explicitly

When the timeout expires, the Saga EIP will decide to *cancel the Saga* (and compensate all participants), unless a different decision has been taken before.

Expand Down Expand Up @@ -371,15 +371,15 @@ that is the default propagation used when nothing else is specified.
These propagation modes map 1:1 the equivalent modes used in transactional contexts. Here's a summary of their meaning:

[width="100%",cols="2m,8",options="header"]
|=======================================================================
|===
| Propagation | Description
| `REQUIRED` | Join the existing saga or create a new one if it does not exist.
| `REQUIRES_NEW` | Always create a new saga. Suspend the old saga and resume it when the new one terminates.
| `MANDATORY` | A saga must be already present. The existing saga is joined.
| `SUPPORTS` | If a saga already exists, then join it.
| `NOT_SUPPORTED` | If a saga already exists, it is suspended and resumed when the current block completes.
| `NEVER` | The current block must never be invoked within a saga.
|=======================================================================
|===

==== Using Manual Completion (Advanced)
When a Saga cannot be all executed in a synchronous way, but it requires e.g. communication with external services using asynchronous communication channels,
Expand Down
25 changes: 25 additions & 0 deletions camel-core/src/main/java/org/apache/camel/impl/cloud/package.html
@@ -0,0 +1,25 @@
<!--
~ 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.
-->
<html>
<head>
</head>
<body>

Base classes and implementation for Camel Cloud

</body>
</html>
Expand Up @@ -19,7 +19,7 @@
</head>
<body>

Base classes and Implementation for Camel Cluster
Base classes and implementation for Camel Cluster

</body>
</html>
25 changes: 25 additions & 0 deletions camel-core/src/main/java/org/apache/camel/impl/saga/package.html
@@ -0,0 +1,25 @@
<!--
~ 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.
-->
<html>
<head>
</head>
<body>

In-memory Saga coordinator.

</body>
</html>
@@ -0,0 +1,27 @@
<!--
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.
-->
<html>
<head>
</head>
<body>

Transformer implementation classes.

</body>
</html>
@@ -0,0 +1,27 @@
<!--
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.
-->
<html>
<head>
</head>
<body>

Validator implementation classes.

</body>
</html>
@@ -0,0 +1,27 @@
<!--
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.
-->
<html>
<head>
</head>
<body>

Saga EIP implementation.

</body>
</html>
Expand Up @@ -21,8 +21,7 @@
</head>
<body>

Performs XML validation using <a href="http://java.sun.com/xml/jaxp/index.jsp">JAXP</a> for validating against XSD or
RelaxNG
Performs XML validation using JAXP for validating against XSD

</body>
</html>
Expand Up @@ -21,9 +21,9 @@
import org.apache.camel.Exchange;
import org.apache.camel.spi.HasId;


/**
* A saga coordinator can be used to register compensators and take the final decision on the saga: compensate or complete (successfully).
* A saga coordinator can be used to register compensator's and
* take the final decision on the saga: compensate or complete (successfully).
*/
public interface CamelSagaCoordinator extends HasId {

Expand Down
Expand Up @@ -36,7 +36,8 @@ public class CamelSagaStep {

private Optional<Long> timeoutInMilliseconds;

public CamelSagaStep(Optional<Endpoint> compensation, Optional<Endpoint> completion, Map<String, Expression> options, Optional<Long> timeoutInMilliseconds) {
public CamelSagaStep(Optional<Endpoint> compensation, Optional<Endpoint> completion,
Map<String, Expression> options, Optional<Long> timeoutInMilliseconds) {
this.compensation = ObjectHelper.notNull(compensation, "compensation");
this.completion = ObjectHelper.notNull(completion, "completionCallbacks");
this.options = ObjectHelper.notNull(options, "options");
Expand Down
27 changes: 27 additions & 0 deletions camel-core/src/main/java/org/apache/camel/saga/package.html
@@ -0,0 +1,27 @@
<!--
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.
-->
<html>
<head>
</head>
<body>

Camel Saga EIP

</body>
</html>
2 changes: 1 addition & 1 deletion camel-core/src/main/java/org/apache/camel/spi/package.html
Expand Up @@ -21,7 +21,7 @@
</head>
<body>

Service Provider Interfaces used internally by the Camel runtime which are plugin strategies.
Service Provider Interfaces used by the Camel runtime which are plugin strategies.

</body>
</html>
@@ -0,0 +1,27 @@
<!--
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.
-->
<html>
<head>
</head>
<body>

Function utility classes

</body>
</html>

0 comments on commit a39733e

Please sign in to comment.