IBM Business Monitor REST event emitter interface (XML)
The IBM® Business Monitor REST event emitter service receives event XML from your application and then sends it to IBM Business Monitor. This REST event emitter supports Dynamic Event Framework (DEF). It does not wrap the XML in a Common Base Event format.
The XSD type is a generic XML Schema Definition. The business information that is defined by the XSD definition is received by the API and forwarded to IBM Business Monitor.
- WBMapplicationName
- WBMversion
- WBMcontextType
- WBMcontextName
- WBMelementType
- WBMelementName
- WBMnature
Event emitter service URIs
https://{hostname}:{port}(WC_defaulthost_secure port)/rest/bpm/monitor/events
For
an installation without security enabled, the format of the event
emitter service URI is as follows:http://{hostname}:{port}(WC_defaulthost port)/rest/bpm/monitor/events
where: - http://{host}:{port} contains the host address and port.
- Resource Reference - com/ibm/monitor/EmitterFactoryForREST
- Context Root - rest/bpm/monitor/events
- Application Name - IBM_WBM_EMITTER_SERVICES
- Security role to user/group mapping - All Authenticated
- URL Resource JNDI Name - monitor/emitter/defaultURL
- Common Base Event Validation - false
- XML Header removal - true
- Resource Reference contains the JNDI name of the configured synchronous common event infrastructure (CEI) emitter factory
- Context Root is the default context root of the event emitter service.
- Application Name is the name of the event emitter service application.
- Security role to user/group mapping is the default security mapping for the event emitter service.
- URL Resource JNDI Name is the JNDI name of the IBM Business Monitor event emitter. You can look up the JNDI name monitor/emitter/defaultURL in your emitter application to invoke the emitter service instead of specifying the URL in the emitter application code.
- Common Base Event Validation can be configured to validate the XML content of events before emitting them to the server. It is disabled by default and set to false. For more information, see "Validating Common Base Events" in the related links.
- XML Header removal removes the XML headers from the event XML automatically because the event emitter cannot process event XML with XML headers. It is enabled by default and set to true. For more information, see "XML header removal" in the related links.
You can deploy multiple copies of the EAR file if you want to use more than one emitter. The EmitterServices.ear file is available in the was_root/installableApps.wbm directory. You can deploy multiple copies of the service manually or use the configuration wizard. When you deploy multiple copies, you must provide a unique application name and a unique context root for each copy, and you must modify the resource reference to contain the JNDI name of a configured emitter that you want to use.
- Resource Reference - com/ibm/events/configuration/emitter/Default
- Context Root - cei/rest/bpm/events
- Application Name - IBM_EMITTER_REST_SERVICES_CEI
- Security role to user/group mapping - All Authenticated
- Resource Reference - com/ibm/events/configuration/emitter/asynch
- Context Root - ceiasynch/rest/bpm/events
- Application Name - IBM_EMITTER_REST_SERVICES_CEIASYNCH
- Security role to user/group mapping - All Authenticated
In a network deployment (ND) environment, if the EmitterServices.ear file is installed on a different server or cluster from the CEI emitter factory, you must set the RESTEmitterFactory resource entry to point to the correct location of the emitter factory. You can configure the emitter factory for each emitter during deployment, or you can modify the resource references on the IBM_WBM_REST_EMITTER_SERVICE application. You can make these changes from the administrative console. Click and click IBM_WBM_EMITTER_REST_SERVICES. Under References, click Resource references and make the changes. Save your changes and restart the application.
If you do not use the configuration wizard to install the emitter services, you must take some extra steps in a secure environment. After deploying the EmitterServices.ear, you must assign the appropriate security role mapping. To make the changes, in the administrative console, click and click IBM_WBM_EMITTER_REST_SERVICES. Under Detail Properties, click Security role to user/group mapping.
Content types
- JSON ("Content-Type: application/json") is used for the detailed format of each returned object. See JSON Schema ([JSON Schema] specifications for each individual operation.
- XML ("Content-Type: text/xml") is used to provide the input business payload when you want to emit a single event to IBM Business Monitor.
- XML ("Content-Type: application/atom+xml") is used to provide the input business payload when you want to batch multiple events.
Using HTTP content-type in REST requests
When a client sends an HTTP request with payload, the HTTP content-type header should be set correctly to describe the payload format. Therefore, clients must be explicit and set the format to either text/xml or application/atom+xml, depending on whether clients are sending a single payload directly in the HTTP request body or multiple event payloads.
http://monitor_server:monitor_server_port/rest/bpm/monitor/events
where: - monitor_server is the host name of the IBM Business Monitor server.
- monitor_server_port is the port where the REST servlet is running.
- REST_URI is the actual URI of the REST service.
https://monitor_server:monitor_server_port/rest/bpm/monitor/events
For
an installation without security enabled, this URL specifies the following
default address:http://monitor_server:monitor_server_port/rest/bpm/monitor/events
You can look up the URL JNDI in your emitter application to access the address where the emitter service is available. This method of looking up the web address of the service shields the emitter application from any changes in the web address. You can add URL definitions as you deploy more copies of the event service.
Error handling
For errors that are recognized during the processing of an IBM Business Monitor REST request, an appropriate HTTP status code ([RFC2616]) is returned to the calling client (for example, 200 OK or 404 Not Found; see the individual operations for details). Additional error information is provided depending on the error type. For IBM Business Monitor exceptions, the corresponding IBM Business Monitor error number and error message are returned. For severe errors (HTTP status code 500 Internal Server Error), additional programmer's details are returned. They can be propagated to IBM service personnel, if required.
If errors are encountered during processing, IBM Business Monitor discards the event, and you must send it again after making any necessary corrections as indicated by the error information that is returned. You might consider using the JMS event emitter, which routes failed events to an error queue when errors are encountered during event emission. The events are not discarded and can be recovered for processing by the event emitting application. For more information, see "Handling events that the JMS event emitter did not emit" in the related links.
References
- [RFC 2616] - Hypertext Transfer Protocol 1.1
- [RFC 2045] - Multipurpose Internet Mail Extensions (MIME), Part 1: Format of Internet Message Bodies
- [RFC 2046] - Multipurpose Internet Mail Extensions (MIME), Part 2: Media Types
- [iana.org] - MIME Media Types
- [JSON Schema] - JSON Schema
- [Atom Format] - application/atom+xml type
- [Atom Entry] - Atom entry
- [Atom Entry] - Atom Feed Format