Relationship with CSP
Client Side Persistence is provided in the 6.0 version and above. Proprietary APIs of FioranoMQ are needed for CSP.
To enable durable connections, client side persistence does not need to be enabled. In CSP, the following had to be set in the client application to enable client side persistence:
env.put(FioranoJNDIContext.ENABLE_CLIENT_SIDE_PERSISTENCE,"true")
env.put(FioranoJNDIContext.CSP_BASE_DIR,"c://myCache");
InitialContext ic = new InitialContext(env);
QueueConnectionFactory qcf = (QueueConnectionFactory)ic.lookup("primaryQCF");
QueueConnection qc = qcf.createQueueConnection();
(FioranoQueueConnection)qc.setCSPConnectionID("myClientID");
In Durable Connections these steps do not need to be performed. The client applications can 'lookup' a ConnectionFactory that has information on the Durable Connection. The application proceeds to set a unique clientID for the connection upon which Durable Connections are to be enabled. This enables messages sent by the sender to be stored in the directory structure specified in the ConnectionFactory (or in the ".\CSPCache" directory) and sent to the server once the connection is revalidated. Fiorano's runtime library handles the above steps, internally.
To enable durable connections, the client application is set to allow durable Connection in the env as a property, while setting a client ID for the connection:
env.put(FioranoJNDIContext.AllowDurableConnections, "true");
InitialContext ic = new InitialContext(env);
QueueConnectionFactory qcf = (QueueConnectionFactory)ic.lookup("primaryQCF");
QueueConnection qc = qcf.createQueueConnection();
qc.setClientID("myClientID");
Messages get stored on the client machine either in the directory specified in the env variable or in ".\CSPCache". Calling an explicit setCSPConnectionID on the connection on which CSP has to be enabled is not required. The only requirement entails setting a ClientID for the connection to enable Durable Connections.