summaryrefslogtreecommitdiffstats
path: root/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-jms/src/site-docs/adoc/fragments/ct-jms-io.adoc
blob: 940857169389c84c6b8e3fd8e366cc6273c9e4ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//
// ============LICENSE_START=======================================================
//  Copyright (C) 2016-2018 Ericsson. All rights reserved.
// ================================================================================
// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE
// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode
// 
// SPDX-License-Identifier: CC-BY-4.0
// ============LICENSE_END=========================================================
//
// @author Sven van der Meer (sven.van.der.meer@ericsson.com)
//

== JMS IO

APEX supports the Java Messaging Service (JMS) as input as well as output.
JMS IO is supported by the APEX JMS plugin.
Input and output support an event encoding as text (JSON string) or object (serialized object).
The input configuration is the same for both encodings, the output configuration differs.


=== JMS Input

APEX will receive events from a JMS messaging system.
The input is uni-directional, an engine will only receive events from the input but not send any event to the input.

[source%nowrap,json]
----
"carrierTechnologyParameters" : {
  "carrierTechnology" : "JMS", <1>
  "parameterClassName" :
      "org.onap.policy.apex.plugins.event.carrier.jms.JMSCarrierTechnologyParameters",
  "parameters" : { <2>
    "initialContextFactory" :
        "org.jboss.naming.remote.client.InitialContextFactory", <3>
    "connectionFactory" : "ConnectionFactory", <4>
    "providerURL" : "remote://localhost:5445", <5>
    "securityPrincipal" : "guest", <6>
    "securityCredentials" : "IAmAGuest", <7>
    "consumerTopic" : "jms/topic/apexIn" <8>
  }
}
----

<1> set JMS as carrier technology
<2> set all JMS specific parameters
<3> the context factory, in this case from JBOSS (it requires the dependency org.jboss:jboss-remote-naming:2.0.4.Final or a different version to be in the directory `$APEX_HOME/lib` or `%APEX_HOME%\lib`
<4> a connection factory for the JMS connection
<5> URL with host and port of the JMS provider
<6> access credentials, user name
<7> access credentials, user password
<8> the JMS topic to listen to


=== JMS Output with Text

APEX engine send events to a JMS messaging system.
The output is uni-directional, an engine will send events to the output but not receive any event from output.

[source%nowrap,json]
----
"carrierTechnologyParameters" : {
  "carrierTechnology" : "JMS", <1>
  "parameterClassName" : 
      "org.onap.policy.apex.plugins.event.carrier.jms.JMSCarrierTechnologyParameters",
  "parameters" : { <2>
    "initialContextFactory" :
        "org.jboss.naming.remote.client.InitialContextFactory", <3>
    "connectionFactory" : "ConnectionFactory", <4>
    "providerURL" : "remote://localhost:5445", <5>
    "securityPrincipal" : "guest", <6>
    "securityCredentials" : "IAmAGuest", <7>
    "producerTopic" : "jms/topic/apexOut", <8>
    "objectMessageSending": "false" <9>
  }
}
----

<1> set JMS as carrier technology
<2> set all JMS specific parameters
<3> the context factory, in this case from JBOSS (it requires the dependency org.jboss:jboss-remote-naming:2.0.4.Final or a different version to be in the directory `$APEX_HOME/lib` or `%APEX_HOME%\lib`
<4> a connection factory for the JMS connection
<5> URL with host and port of the JMS provider
<6> access credentials, user name
<7> access credentials, user password
<8> the JMS topic to write to
<9> set object messaging to `false` means it sends JSON text


=== JMS Output with Object

To configure APEX for JMS objects on the output interface use the same configuration as above (for output).
Simply change the `objectMessageSending` parameter to `true`.