blob: e3725714e0fef6552e8fce5dbb75531d6f8f8daf [file] [log] [blame]
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -04001.if false
2==================================================================================
Lott, Christopher (cl778h)5157a972020-04-06 20:31:32 -04003 Copyright (c) 2019 Nokia
4 Copyright (c) 2018-2019 AT&T Intellectual Property.
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -04005
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17==================================================================================
18.fi
19.if false
Lott, Christopher (cl778h)5157a972020-04-06 20:31:32 -040020 Mnemonic rmr.7.xfm
E. Scott Daniels117030c2020-04-10 17:17:02 -040021 Abstract The manual page for the whole RMR library
Lott, Christopher (cl778h)5157a972020-04-06 20:31:32 -040022 Author E. Scott Daniels
23 Date 29 January 2019
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040024.fi
25
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040026.gv e LIB lib
E. Scott Danielsffba61c2019-07-29 14:28:00 -040027.im &{lib}/man/setup.im
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040028
29&line_len(6i)
30
E. Scott Daniels117030c2020-04-10 17:17:02 -040031&h1(RMR Library)
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040032&h2(NAME)
E. Scott Daniels117030c2020-04-10 17:17:02 -040033 RMR -- Ric Message Router Library
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040034
35&h2(DESCRIPTION)
E. Scott Daniels117030c2020-04-10 17:17:02 -040036RMR is a library which provides a user application with the ability
37to send and receive messages to/from other RMR based applications
Lott, Christopher (cl778h)5157a972020-04-06 20:31:32 -040038without having to understand the underlying messaging transport environment (e.g., SI95)
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040039and without needing to know which other endpoint applications are currently
40available and accepting messages.
E. Scott Daniels117030c2020-04-10 17:17:02 -040041To do this, RMR depends on a routing table generated by an external source.
E. Scott Danielsc1aee2b2019-04-19 21:12:25 +000042This table is used to determine the destination endpoint of each message sent by mapping the
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040043message type T (supplied by the user application) to an endpoint entry.
44Once determined, the message is sent directly to the endpoint.
45The user application is unaware of which endpoint actually receives the
46message, and in some cases whether that message was sent to multiple
47applications.
48
49&space
E. Scott Daniels117030c2020-04-10 17:17:02 -040050RMR functions do provide for the ability to respond to the specific source
E. Scott Danielsc1aee2b2019-04-19 21:12:25 +000051instance of a message allowing for either a request response, or call
E. Scott Danielsd9de79a2019-10-31 09:20:33 -040052response relationship when needed.
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040053
54
55&h3(The Route Table)
E. Scott Daniels0b79fc22019-12-04 15:20:16 -050056The library must be given a route table which maps message numbers to
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040057endpoint groups such that each time a message of type T is sent, the message
E. Scott Danielsc1aee2b2019-04-19 21:12:25 +000058is delivered to one member of each group associated with T.
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040059For example, message type 2 might route to two different groups where
60group A consists of worker1 and worker2, while group B consists only of
61logger1.
62
63&space
64It is the responsibility of the route table generator to know which endpoints
E. Scott Danielsc1aee2b2019-04-19 21:12:25 +000065belong to which groups, and which groups accept which message types.
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040066Once understood, the route table generator publishes a table that is ingested
E. Scott Daniels117030c2020-04-10 17:17:02 -040067by RMR and used for mapping messages to end points.
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040068
E. Scott Daniels0b79fc22019-12-04 15:20:16 -050069.sp
70The following is a simple route table which causes message types 0 through 9 to
71be routed to specific applications:
72
73&ex_start
74newrt|start
75 mse|0|-1| %meid
76 mse|1|-1|app10:4560,app11:4560
77 mse|2|-1|app12:4560
78 mse|3|-1|app14:4560
79 mse|4|-1|app18:4560
80 mse|5|-1|app01:4560
81 mse|6|-1|app02:4560
82 mse|7|-1|app03:4560
83 mse|8|-1|app04:4560
84 mse|9|-1|app05:4560
85newrt|end
86&ex_end
87&space
88The special endpoint "%meid" indicates that the message type (0 in this case) is
89to be routed to the endpoint which has been listed as the "owner" for the meid
90appearing in the message.
91MEID ownership is communicated to RMR using the same Route Table Manager interface
92and by supplying a "table" such as the one below:
93
94&ex_start
95meid_map | start
96 mme_ar | control1 | meid000 meid001 meid002 meid003 meid004 meid005
E. Scott Daniels190665f2019-12-09 09:05:22 -050097 mme_ar | control2 | meid100 meid101 meid102 meid103
E. Scott Daniels0b79fc22019-12-04 15:20:16 -050098meid_map | end | 2
99&ex_end
100
101This table indicates that the application (endpoint) &ital(control1) "owns" 6 MEIDs
Lott, Christopher (cl778h)5157a972020-04-06 20:31:32 -0400102and &ital(control2) owns 4.
E. Scott Daniels190665f2019-12-09 09:05:22 -0500103When message type 0 is sent, the MEID in the message will be used to select the
104endpoint via this table.
E. Scott Daniels0b79fc22019-12-04 15:20:16 -0500105
106&space
107The MEID table will update the existing owner relationships, and add new ones; it
108is necessary to send only the changes with the add/replace (mme_ar) entries in
E. Scott Daniels190665f2019-12-09 09:05:22 -0500109the table.
E. Scott Daniels0b79fc22019-12-04 15:20:16 -0500110When necessary, MEIDs can be deleted by adding an &cw(mme_del) record to the table.
111The following example illustrates how this might look:
112
113&ex_start
114meid_map | start
115 mme_ar | control1 | meid000 meid001 meid002 meid003 meid004 meid005
E. Scott Daniels190665f2019-12-09 09:05:22 -0500116 mme_ar | control2 | meid100 meid101 meid102 meid103
E. Scott Daniels0b79fc22019-12-04 15:20:16 -0500117 mme_del| meid200 meid401
E. Scott Daniels190665f2019-12-09 09:05:22 -0500118meid_map | end | 3
E. Scott Daniels0b79fc22019-12-04 15:20:16 -0500119&ex_end
120
121&h3(Route Table Syntax)
122The following illustrates the syntax for both the route table.
123
124&space
125&ex_start
126newrt | start
127mse | <message-type>[,<sender-endpoint>] | <sub-id> <roud-robin-grp>[;<round-robin-grp>]...
128newrt | end
129&ex_end
130&space
131A round robin group is one or more endpoints from which one will be selected to receive
E. Scott Daniels190665f2019-12-09 09:05:22 -0500132the message.
E. Scott Daniels0b79fc22019-12-04 15:20:16 -0500133When multiple endpoints are given in a group, they must be separated with a comma.
134An endpoint is the IP address and port (e.g. 192.158.4.30:8219) or DNS name and port of the
135application that should receive the message type.
E. Scott Daniels190665f2019-12-09 09:05:22 -0500136If multiple round-robin groups are given, they must be separated by a semicolon, and
E. Scott Daniels0b79fc22019-12-04 15:20:16 -0500137
138&h3(MEID Map Syntax)
E. Scott Daniels190665f2019-12-09 09:05:22 -0500139The MEID map is similar to the route table.
140Entries are used to add or replace the ownership of one or more MEIDs (mme_ar) or to
E. Scott Daniels0b79fc22019-12-04 15:20:16 -0500141delete one or more MEIDs (mme_del).
142The following is the syntax for the MEID map.
143
144&space
145&ex_start
146meid_map | start
147mme_ar | <owner-endpoint> | <meid> [<meid>...]
148mme_del | <meid> [<meid>...]
E. Scott Daniels190665f2019-12-09 09:05:22 -0500149meid_map | end | <count> [| <md5sum>
E. Scott Daniels0b79fc22019-12-04 15:20:16 -0500150&ex_end
151
152&space
153The <count> on the end record indicates the number of mme_ar and mme_del records
154which were sent; if the count does not match the whole map is refused and dropped.
155The <owner-endpoint> is the endpoint which should receive the message when a message
156is routed based on the MEID it contains.
157A MEID may be "owned" by only one endpoint, and if supplied multiple times, the last
158observed relationship is used.
159Each of the lists of MEIDs are blank separated.
160
E. Scott Daniels190665f2019-12-09 09:05:22 -0500161&space
162The optional <md5sum> on the &ital(end) record should be the computed MD5 hash for all
163records which appear between the start and and records.
164This allows for a tighter verification that all data was received exactly as the
165route manager transmitted them.
166
E. Scott Daniels0b79fc22019-12-04 15:20:16 -0500167
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400168&h3(Environment)
E. Scott Danielsc1aee2b2019-04-19 21:12:25 +0000169To enable configuration of the library behaviour outside of direct user application
E. Scott Daniels117030c2020-04-10 17:17:02 -0400170control, RMR supports a number of environment variables which provide information
E. Scott Danielsd9de79a2019-10-31 09:20:33 -0400171to the library.
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400172The following is a list of the various environment variables, what they control
E. Scott Daniels117030c2020-04-10 17:17:02 -0400173and the defaults which RMR uses if undefined.
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400174
E. Scott Daniels0b79fc22019-12-04 15:20:16 -0500175&space
E. Scott Daniels392168d2019-11-06 15:12:38 -0500176.** the list of environment vars supported
177.im &{lib}/man/env_var_list.im
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400178
179
180&h2(SEE ALSO )
181.ju off
182rmr_alloc_msg(3),
E. Scott Daniels08aee4a2019-04-19 19:51:41 +0000183rmr_tralloc_msg(3),
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400184rmr_call(3),
185rmr_free_msg(3),
186rmr_init(3),
E. Scott Daniels08aee4a2019-04-19 19:51:41 +0000187rmr_init_trace(3),
E. Scott Daniels4ac73e32019-08-13 11:35:04 -0400188rmr_get_meid(3),
E. Scott Danielsc1aee2b2019-04-19 21:12:25 +0000189rmr_get_src(3),
E. Scott Daniels68d09fa2019-06-03 19:45:12 +0000190rmr_get_srcip(3),
E. Scott Daniels08aee4a2019-04-19 19:51:41 +0000191rmr_get_trace(3),
192rmr_get_trlen(3),
E. Scott Daniels4ac73e32019-08-13 11:35:04 -0400193rmr_get_xact(3),
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400194rmr_payload_size(3),
195rmr_rcv_msg(3),
196rmr_rcv_specific(3),
197rmr_rts_msg(3),
198rmr_ready(3),
199rmr_fib(3),
200rmr_has_str(3),
201rmr_tokenise(3),
202rmr_mk_ring(3),
E. Scott Danielsd9de79a2019-10-31 09:20:33 -0400203rmr_realloc_payload(3),
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400204rmr_ring_free(3),
E. Scott Daniels08aee4a2019-04-19 19:51:41 +0000205rmr_set_trace(3),
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400206rmr_torcv_msg(3),
207rmr_wh_open(3),
208rmr_wh_send_msg(3)
209.ju on
210
211