Overview
UHIMS Events refers to messages that UHIMS publishes to the UH Message Broker. It is a convenient way of receiving identity, affiliation, and contact information about the students, faculty and staff that your application serves. The data comes from several official sources, including Banner, PeopleSoft, RCUH, SECE and WPMS. UHIMS digests the information from these various systems and makes it available in one place.
Message Specs
- UHIMS Events - Message Specs
- UHIMS Events - Message Specs (future), includes retrofit messages
Note that <messageRoutingKey> in the above specs is not an actual XML tag. It represents the message routing key for the message being described.
Connection Settings
Setting |
Value |
Comments |
---|---|---|
Host |
esb.hawaii.edu |
|
Port |
5671 |
SSL |
Vhost |
uhims |
|
Exchange |
uhims-exchange |
|
User, Password |
(app-specific) |
This will be provided when you request your UH Message Broker account |
Queue and Bindings |
(app-specific) |
This will be provided when you request your UH Message Broker account |
Requesting Access
- Review UHIMS Events - Message Specs and determine which messages you are interested in.
- Contact its-iam-help@lists.hawaii.edu to request access:
- Provide a desired username for the UH Message Broker. This should be something related to your application, not your personal username, e.g.
- student_housing
- Provide a desired queue name. It will always be preceded by the above username, e.g.
- student_housing.prod
You must register your queues with us. We will declare the queue and its bindings for you. This is to ensure the queues exist and have the correct settings for persistence, high-availability, etc.
- Provide the message routing key pattern for the messages you want to be routed to your queue. It is OK to provide multiple patterns. Here are some examples:
- # (you are interested in all messages)
- username.# (you only want username messages)
- affiliation...uhm.hris (you only want affiliation changes for UH Manoa coming from PeopleSoft)
- Provide a desired username for the UH Message Broker. This should be something related to your application, not your personal username, e.g.
Reading UHIMS Events - Java Example
- Download the RabbitMQ Java client from http://www.rabbitmq.com/download.html (there should be libraries and examples for other languages there)
- Here is a SampleUhimsConsumer.java you can try.
- Replace the following with your own values:
- yourRabbitMqUsernameHere
- yourRabbitMqPasswordHere
- yourQueueNameHere
- esb-test.its.hawaii.edu with esb.hawaii.edu when your code is ready to use the production RabbitMQ service.
import java.io.*; import java.security.*; import com.rabbitmq.client.*; public class SampleUhimsConsumer { private final static String queueName = "yourRabbitMqUsernameHere.yourQueueNameHere"; private final static String exchangeName = "uhims-exchange"; private final static boolean durable = true; private final static boolean exclusive = true; private final static boolean autoDelete = false; private final static boolean autoAck = true; public static void main(String[] argv) throws Exception { ConnectionFactory factory = new ConnectionFactory(); factory.setHost("esb-test.its.hawaii.edu"); factory.setPort(5671); factory.setVirtualHost("uhims"); factory.setUsername("yourRabbitMqUsernameHere"); factory.setPassword("yourRabbitMqPasswordHere"); factory.useSslProtocol(); // Tells the library to setup the default Key and Trust managers for you // which do not do any form of remote server trust verification Connection conn = factory.newConnection(); Channel channel = conn.createChannel(); System.out.println(" [*] Waiting for messages. To exit press CTRL+C"); QueueingConsumer consumer = new QueueingConsumer(channel); channel.basicConsume(queueName, autoAck, consumer); while (true) { QueueingConsumer.Delivery delivery = consumer.nextDelivery(); String message = new String(delivery.getBody()); // Your code processes the message here System.out.println(" [x] Received '" + message + "'"); // If your code fails to acknowledge the message, // it will be redelivered. This is a safety feature. // Refer to Message Acknowledgement section in // http://www.rabbitmq.com/tutorials/tutorial-two-java.html channel.basicAck(delivery.getEnvelope().getDeliveryTag(), false); } } }
- Replace the following with your own values:
- To quickly compile and run the above, you could save the above code as SampleUhimsConsumer.java in the same directory where you downloaded the above Java client (we tried it with rabbitmq-java-client-bin-2.7.1):
- javac -cp rabbitmq-client.jar SampleUhimsConsumer.java
- java -cp .:commons-io-1.2.jar:commons-cli-1.1.jar:rabbitmq-client.jar SampleUhimsConsumer
- That's it!