With Large Message Support (LMS) in FioranoMQ, clients can transfer large files in the form of large messages with theoretically no limit on the message size. Large messages can be attached with any JMS message and the client can be sure of a reliable and secure transfer of the message through FioranoMQ Server.
The following classes and functions are used in LMS.

CFioranoConnection

These two functions are used for resuming any pending large messages.

CRecoverableMessagesEnum *getUnfinishedMessagesToSend() FMQCONST

          This function Returns the enumeration of Messages whose transfers are pending as they were not fully sent.

CRecoverableMessagesEnum *getUnfinishedMessagesToReceive() FMQCONST;

          This function Returns the enumeration of Messages which were not fully received and need to be resumed.

CRecoverableMessagesEnum

This class is the enumeration of Unfinished Messages.

Inheritance Hierarchy

None

Subclasses

None

Constructors

CRecoverableMessagesEnum(RMEnum enumr);

Parameters:

  • enumr  - _RecoverableMessagesEnum structure defined in C runtime.

Methods

bool hasMoreElements() FMQCONST

Returns true if there are more elements in the enumeration, false otherwise

Parameters: None

Returns: Returns true if there are more elements in the enumeration, false otherwise

 

CMessage *nextElement() FMQCONST

Return the next element (CMessage Object) of the enumeration.

Parameters: None

Returns: Returns CMessage Object

CLargeMessage

Inheritance Hierarchy

None

Subclasses

CMessage

Constructors

Default

Methods

virtual void setLMStatusListener(CLMStatusListener *listener, const mqint updateFrequency)

Sets the status listener for the message. This function is used to know the status of message transfer asynchronously.

      Parameters

                 listener - CLMStatusListener object

                  updateFrequency - how frequently the LMS status has to be updated

      Returns: void

 

virtual CLMStatusListener *getLMStatusListener() FMQCONST

Gets the status listener for the message.

      Parameters: None

      Returns: CLMStatusListener object

 

virtual void SaveTo(mqcstring fileName, bool isBlocking)

Saves the contents of the message in the file specified.

      Parameters

               fileName - file name to save.

                isBlocking - boolean for blocking or non blocking

      Returns: void

 

virtual void resumeSaveTo(bool isBlocking)

Resumes saving the contents of the message in the file specified.

      ParametersisBlocking: boolean for blocking or non blocking

      Returns: void

 

virtual void resumeSend()

Resumes an incomplete transfer. This function is used to resume a message transfer which could not be completed earlier either due to some internal error or due to some problem at the client side.

      Parameters: None

      Returns: void

 

virtual void cancelAllTransfers()

Cancels all message transfers which are currently transferring this message. A cancelled transfer also removes the resume information of the transfer. Hence a transfer once cancelled cannot be resumed.

      Parameters: None

      Returns: void

 

virtual void cancelTransfer(mqint consumerID)

Cancels the transfer specified by the consumerID. A cancelled transfer also removes the resume information of the transfer. Hence a transfer once cancelled cannot be resumed.

      ParametersconsumerID - Id of the consumer for which the transfer has to be stopped.

      Returns: void

 

virtual void suspendAllTransfers ()

Suspends all the message transfers which are transferring this large message temporarily. Suspending a transfer only stops the thread which is doing the message transfer and does not delete resume related information. Hence, a suspended transfer can be resumed using resume functions.

      Parameters: None

      Returns: void

 

virtual void suspendTransfer(mqint consumerID)

Suspends the transfer specified by the consumerID temporarily. Suspending a transfer only stops the thread which is doing the message transfer and does not delete resume related information. Hence, a stopped transfer can be resumed using resume functions

      Parameters: consumerID - Id of the consumer for which the transfer has to be suspended.

      Returns: void

 

virtual void setFragmentSize(const mqint size)

Sets the fragment size for the message.

     Parameters: sizesize of the fragment in int

     Returns: mqlong

 

virtual int getFragmentSize() FMQCONST

Gets the fragment size of the message.

      Parameters: None

      Returns: Int – returns the size

 

virtual void  setWindowSize(const mqint size)

Sets the frequency after which acknowledgement will be sent

      Parameters: size – size of the window in integerReturns: void

 

virtual int getWindowSize() FMQCONST

Gets the window size of the message.

      Parameters: None

      Returns: size – size of the window in integer

virtual void setRequestTimeoutInterval(const mqlong timeout)

Sets the time until which the sender will wait for message transfer to start

      Parameters: timeout - time in mqlong (in milliseconds)

      Returns: void

 

virtual mqlong getRequestTimeoutInterval() FMQCONST

Gets the time until which the sender will wait for message transfer to start

      Parameters: None

      Returns: mqlong

 

virtual void setResponseTimeoutInterval(const mqlong responseInterval)

Sets the time until which the sender/receiver will wait for message from the other end.

      Parameters: responseInterval - responseInterval time as mqlong (in milliseconds)

      Returns: void

 

virtual mqlong getResponseTimeoutInterval() FMQCONST

Gets the time until which the sender/receiver will wait for messages from the other end.

      Parameters: None

      Returns: mqlong

CLMStatusListener

This class listens to the status of the Large Message received or sent. This has one virtual function which has to over ridden in Status Listener implementation. Refer to the lms samples for the sample implementation of this class.

Inheritance Hierarchy

None

Subclasses

None

Constructors

Default

Methods

virtual void onLMStatus(CLMTransferStatus *status, bool exception) = 0

Notifies the user with large message status. The user is expected to override this function with the required functionality.

      Parametersstatus - CLMTransferStatus object which holds the status.

      Exception: Boolean indicating whether exception occured or not.

      Returns: Void

CLMTransferStatus

This class provides methods that provide information about the status of the Message transfer such as number of bytes transferred, number of bytes left to be transferred, etc.

Inheritance Hierarchy

None

Subclasses

None

Constructors

CLMTransferStatus(LMTransferStatus status)

Parameters:

  • status- LMTransferStatus structure defined in C runtime.

Methods

mqlong getBytesTransferred() FMQCONST

Returns the number of bytes transferred.

      Parameters: None

      Returns: number of bytes transferred

 

mqlong getBytesToTransfer() FMQCONST

Returns the number of bytes to be transferred.

      Parameters: None

      Returns: number of bytes to be transferred.

 

mqlong getLastFragmentID() FMQCONST

Returns the ID of the last fragment.

      Parameters: None

      Returns: ID as mqlong

 

float getPercentageProgress() FMQCONST

The percentage of the progress of message transfer.

      Parameters: None

      Returns: Returns the percentage of the progress message transfer in float

 

mqbyte getStatus()

Returns the status of the Message transfer.

  • LM_TRANSFER_NOT_INIT or 1

Indicates that the transfer has not yet started

  • LM_TRANSFER_IN_PROGRESS or 2

Indicates that transfer is currently in progress

  • LM_TRANSFER_DONE or 3

Indicates that the transfer is complete for one consumer

  • LM_TRANSFER_ERR or 4

Indicates that an error occurred during the transfer

  • LM_ALL_TRANSFER_DONE or 5

Indicates that the transfer is complete for all consumers

      Parameters: None

      Returns: Returns the status of the Message transfer.

 

bool isTransferComplete() FMQCONST

Returns true if transfer completes, else returns false.

      Parameters: None

      Returns: true if transfer completes, else returns false.

 

bool isTransferCompleteForAll() FMQCONST

Returns true if all the transfers are completed, else returns false.

      Parameters: None

      Returns: true if all the transfers are completed, else returns false

 

CLargeMessage *getLargeMessage() FMQCONST

Returns the large message for which this status is created.

      Parameters: None

      Returns: The large message

 

int getConsumerID() FMQCONST

Returns the consumerID of the connection that is being used.

      Parameters: None

      Returns: Returns the consumerID

Adaptavist ThemeBuilder EngineAtlassian Confluence