-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add another service
- Loading branch information
Showing
7 changed files
with
104 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{% extends 'layout.html.twig' %} | ||
|
||
{% block contents %} | ||
<div id="welcome"> | ||
<h1><span>Embeded version</span> {{ service }} @ {{ page }}</h1> | ||
</div> | ||
|
||
<pre style="border: 1px solid #333;">{{ contents }}</pre> | ||
|
||
<div id="next"> | ||
<h2>What's next?</h2> | ||
<p> | ||
<a href="{{ path('home') }}">Back to home</a> | ||
</p> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,25 @@ | ||
app: | ||
service1: | ||
build: . | ||
volumes: | ||
- .:/app | ||
links: | ||
- neo4j | ||
- service2 | ||
expose: | ||
- 80 | ||
environment: | ||
TOLERANCE_SERVICE_NAME: "First Service" | ||
|
||
service2: | ||
build: . | ||
volumes: | ||
- .:/app | ||
links: | ||
- neo4j | ||
expose: | ||
- 80 | ||
environment: | ||
TOLERANCE_SERVICE_NAME: "Second Service" | ||
|
||
neo4j: | ||
image: neo4j | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace App\Tolerance; | ||
|
||
use Tolerance\MessageProfile\Peer\ArbitraryPeer; | ||
use Tolerance\MessageProfile\Peer\Resolver\PeerResolver; | ||
|
||
final class CurrentPeerEnhancer implements PeerResolver | ||
{ | ||
/** | ||
* @var PeerResolver | ||
*/ | ||
private $decoratedPeerResolver; | ||
|
||
/** | ||
* @param PeerResolver $decoratedPeerResolver | ||
*/ | ||
public function __construct(PeerResolver $decoratedPeerResolver) | ||
{ | ||
$this->decoratedPeerResolver = $decoratedPeerResolver; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function resolve() | ||
{ | ||
$peer = $this->decoratedPeerResolver->resolve(); | ||
|
||
return ArbitraryPeer::fromArray(array_merge($peer->getArray(), [ | ||
'service' => getenv('TOLERANCE_SERVICE_NAME'), | ||
'container' => getenv('HOSTNAME'), | ||
])); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters