Category Archives: Definitions

What is Daemon Thread and User Threads in Java ?

In java we have two type of Threads : Daemon Thread and User Threads. Generally all threads created by programmer are user thread (unless you specify it to be daemon or your parent thread is a daemon thread). User thread are generally meant to run our programm code. JVM doesn’t terminates unless all the user thread terminate.On the other hand we have Daemon threads. Typically these threads are service provider threads. They should not be used to run your program code but some system code. These thread run paralley to your code but survive on the mercy of the JVM. When JVM finds no user threads it stops and all daemon thread terminate instantly. Thus one should never rely on daemon code to perform any program code.

For better understanding consider a well known example of Daemon thread : Java garbage collector. Garbage collector runs as a daemon thread to recalim any unused memory. When all user threads terminates, JVM may stop and garbage collector also terminates instantly.

What is WS-RM ?

WS-ReliableMessaging describes a protocol that allows SOAP messages to be reliably delivered between distributed applications in the presence of software component, system, or network failures.

what is ws-rm?

An Application Source wishes to reliably send messages to an Application2 (destination) over an unreliable infrastructure. Then to accomplish this they make use of a Reliable Messaging Source and a Reliable Messaging Destination  The Application Source sends a message to the Reliable Messaging Source. The Reliable Messaging Source ( RMS) uses the WS-ReliableMessaging (WS-RM) protocol to transmit the message to the Reliable Messaging Desitination (RMD). The RMD delivers the message to the Application2 Destination. If for somereason that the RMS can’t transmit the message to the RMD for some reason, it raises an exception or otherwise indicate to the Application (Source) that the message was not transmitted.

The WS-RM protocol defines and supports a number of Delivery Assurances. These are:

  1. AtLeastOnce – Each message will be delivered to the Application (Destination) at least once. If a message cannot be delivered, an error always will be raised by the RMS or RMD.
  2. Messages may be delivered to the Application (Destination) more than once
  3. AtMostOnce – Each message will be delivered to the Application (Destination) at most once.
  4. ExactlyOnce – Each message will be delivered to the Application (Destionation) exactly once. If a message cannot be delivered, an error will be raised by the RMS or RMD.
  5. InOrder – Messages will be delivered from the RMD to the Application (Destination) in the order that they are sent from the Application Source to the RMS. This assurance can be combined with any of the above assurances.