Skip to content

Commit 9d5876c

Browse files
authored
Description how to override message service library added (#205)
* Description how to override message service library added Fixes #204 The new MD file describes how to override message service library included in generate service. This can be useful for many reasons, e.g. custom library should be used, etc. * Link to JitPack added to documention. * JitPack URL fixed. * -Djava.ext.dirs replaced by -classpath Option -Djava.ext.dirs has been deprecated in Java 8u40. * Link to example in eiffel-remrem-publish added.
1 parent e76f55f commit 9d5876c

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ Eiffel REMReM Generate takes a partial message in JSON format, validates it and
4242

4343
7. [**Logging**](wiki/markdown/logging.md)
4444

45+
7. [**Overriding Message Service Library**](wiki/markdown/overriding.md)
46+
4547
# About this repository
4648
The contents of this repository are licensed under the [Apache License 2.0](./LICENSE).
4749

wiki/markdown/overriding.md

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
## Overriding Message Service Library
2+
3+
When building ``eiffel-remrem-generate`` and ``eiffel-remrem-publish`` services,
4+
target packages include also ``eiffel-remrem-semantics`` library
5+
of a version given by services' ``POM`` file. This can be easily verified sending
6+
``/versions`` request to the services. It produces something like that
7+
~~~
8+
{
9+
"serviceVersion": {
10+
"version": "2.1.4"
11+
},
12+
"endpointVersions": {
13+
"semanticsVersion": "2.2.1"
14+
}
15+
}
16+
~~~
17+
18+
If there is a need, for whatever reason, to use different version of semantics
19+
library, appropriate JAR file can be stored in a directory listed as value of Java
20+
option ``-classpath`` utilizing [wildcard mechanism](https://docs.oracle.com/javase/7/docs/technotes/tools/windows/classpath.html).
21+
For example, when ``eiffel-remrem-semantics-2.1.3.jar``
22+
is stored in, say, ``/eiffel/protocols``, the directory must be included in ``java``
23+
command
24+
~~~
25+
java ... -classpath "...:/eiffel/protocols/*:..." -jar .../generate.war
26+
~~~
27+
28+
Note, that [Resources 'earlier' on the classpath take precedence over resources that are specified after them](https://stackoverflow.com/questions/6644440/java-which-of-multiple-resources-on-classpath-jvm-takes).
29+
30+
New request to ``/versions`` now clearly proves that implementation from newly
31+
deployed library is used instead of build-in one.
32+
~~~
33+
{
34+
"serviceVersion": {
35+
"version": "2.1.4"
36+
},
37+
"endpointVersions": {
38+
"semanticsVersion": "2.1.3"
39+
}
40+
}
41+
~~~
42+
43+
44+
This feature can be utilized to load completely different implementation of Eiffel
45+
protocol, for example ``eiffel3``, by adding corresponding library into directory
46+
included in ``-classpath``, i.e. ``/eiffel/protocols``. The newly added library
47+
causes that output of ``/versions`` request looks like this
48+
~~~
49+
{
50+
"serviceVersion": {
51+
"version": "2.1.4"
52+
},
53+
"endpointVersions": {
54+
"semanticsVersion": "2.1.3",
55+
"eiffel3MessagingVersion": "29.0.9"
56+
}
57+
}
58+
~~~
59+
60+
Particular version of ``eiffel-remrem-semantics`` can be downloaded from
61+
[JitPack](https://jitpack.io/#eiffel-community/eiffel-remrem-semantics).
62+
63+
A practial example can be found in chapter [Override RemRem-Publish Eiffel Protocol Version](https://github.com/eiffel-community/eiffel-remrem-publish/blob/master/wiki/markdown/run.md#override-remrem-publish-eiffel-protocol-version).

0 commit comments

Comments
 (0)