|
| 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