Service requests and responses can be monitored by other
systems by using events. By setting an event point, a local mapping
service can emit events when it intercepts a service request.
About this task
Use the
createLMServiceEventPoint command
to create an event point on an existing local mapping service.
Note: You
can create event points only by using the command-line method.
Procedure
- Start wsadmin by starting the wsadmin scripting tool.
- Use the following createLMServiceEventPoint command
to create an event point on the specified local mapping service:
AdminTask.createLMServiceEventPoint('-lmService DemoLM -mustSend false -sendAtCommit true -eventData envelope -connectionFactory myJmsCF -topic myJmsTopic')
The
value that you provide for the -connectionFactory parameter
must be the JNDI name that you used when you created the connection
factory. See Producing and consuming service mapping events.
This
example specifies values for all the required and optional parameters
of the command. For more information, see
createLMServiceEventPoint command. If you do not
specify a value for the
-topic parameter, events
are published to a topic by using the default topic string:
$SYS/AppServer/<cell_name>/<node_name>.<server_name>|<cluster_name>/<client_application_name>/<LMS_name>/<operation_name>
Where either <node_name>.<server_name> must
be specified, or <cluster_name> must
be specified, depending on your configuration.Note: This
default topic string is passed to the Session.createTopic() method
of the JMS provider. The string is compatible with both the default
messaging provider for WebSphere Application Server and WebSphere MQ JMS providers. However,
the string might not be compatible with other JMS providers. For JMS
providers where the default topic string is not compatible with the Session.createTopic() method,
you must specify a JMS topic when you create the event point.
- When the event point is created, you can see the details
of the event point by using the showLMService command:
AdminTask.showLMService('DemoLM')
The details of the local mapping service now include the
event point information: {name=DemoLM, description=DemoLM, consumedService=[{portType=MyServicePort, namespace=http://test, serviceName=MyServiceService, targetEndpoint=http://localhost:9080/DemoJAXWSProject/MyServiceService, portName=MyServicePort}], serviceStatus=LocalMappingServiceState.STARTED, eventPoint={enabled=false, mustSend=false, sendAtCommit=true, eventData=envelope, connectionFactory=myJmsCF, topic=myJmsTopic}}
- The event point is disabled by default. Use the enableLMServiceEventPoint command
to enable it, as shown here:
AdminTask.enableLMServiceEventPoint('-lmService DemoLM')
- Save your configuration changes by using the following
command:
AdminConfig.save()
- If you are in a clustered environment, you must synchronize
the nodes. Use the syncActiveNodes script in the AdminNodeManagement script
library to synchronize each active node in your environment, as the
following example demonstrates:
AdminNodeManagement.syncActiveNodes()
Results
When the local mapping service intercepts service requests,
response messages, and fault messages, an event is published to the
JMS provider specified by the connection factory JNDI name.