Skip to content

Commit fb816f0

Browse files
Big Bang
1 parent e13b4b8 commit fb816f0

4 files changed

Lines changed: 108 additions & 0 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea
2+
vendor

composer.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "soa-php/traceability",
3+
"description": "Trace the conversations between your services",
4+
"license": "MIT",
5+
"require": {
6+
"php": "^7.2"
7+
},
8+
"autoload": {
9+
"psr-4": {
10+
"Soa\\Traceability\\": "src/"
11+
}
12+
}
13+
}

docker/run.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
COMMAND=${1:-}
4+
shift
5+
6+
run_in_docker="docker run -it --rm -v $PWD:/srv/app -w /srv/app --user ${UID} mgonzalezbaile/php_base:1.0"
7+
8+
case "$COMMAND" in
9+
composer)
10+
${run_in_docker} composer $@
11+
;;
12+
exec)
13+
${run_in_docker} $@
14+
;;
15+
esac

src/Trace.php

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Soa\Traceability;
6+
7+
class Trace
8+
{
9+
/**
10+
* @var string
11+
*/
12+
private $occurredOn;
13+
14+
/**
15+
* @var string
16+
*/
17+
private $correlationId;
18+
19+
/**
20+
* @var string
21+
*/
22+
private $causationId;
23+
24+
/**
25+
* @var string
26+
*/
27+
private $replyTo;
28+
29+
/**
30+
* @var string
31+
*/
32+
private $processId;
33+
34+
/**
35+
* @var string
36+
*/
37+
private $messageId;
38+
39+
public function __construct(string $messageId, string $occurredOn, string $correlationId, string $causationId, string $replyTo, string $processId)
40+
{
41+
$this->occurredOn = $occurredOn;
42+
$this->correlationId = $correlationId;
43+
$this->causationId = $causationId;
44+
$this->replyTo = $replyTo;
45+
$this->processId = $processId;
46+
$this->messageId = $messageId;
47+
}
48+
49+
public function occurredOn(): string
50+
{
51+
return $this->occurredOn;
52+
}
53+
54+
public function correlationId(): string
55+
{
56+
return $this->correlationId;
57+
}
58+
59+
public function causationId(): string
60+
{
61+
return $this->causationId;
62+
}
63+
64+
public function replyTo(): string
65+
{
66+
return $this->replyTo;
67+
}
68+
69+
public function processId(): string
70+
{
71+
return $this->processId;
72+
}
73+
74+
public function messageId(): string
75+
{
76+
return $this->messageId;
77+
}
78+
}

0 commit comments

Comments
 (0)