# ICMessageSynchronizationPolicy

Describes the extent of message synchronization that should occur. A synchronization policy is a combination of mode and limit attributes that describe whether no, limited or full synchronization should occur.

[block:parameters]
{
  "data": {
    "h-0": "Return Type",
    "h-1": "Method",
    "0-0": "void",
    "0-1": "[setMode(ICMessageSynchronizationMode mode)](#section-set-mode)",
    "1-0": "void",
    "1-1": "[setLimits(int maxThreads, int maxMessagesPerThread)](#section-set-limits)"
  },
  "cols": 2,
  "rows": 2
}
[/block]

\##setMode

Sets the mode of synchronization, either None, Limited or Full.

  **Syntax:** `void setMode(ICMessageSynchronizationMode mode)`

**Parameters**

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Type",
    "h-2": "Description",
    "0-0": "mode",
    "0-2": "A valid mode setting of None, Limited or Full.",
    "0-1": "[ICMessageSynchronizationMode](https://developers.imiconnect.io/docs/enumerations-2#icmessagesynchronizationmode)"
  },
  "cols": 3,
  "rows": 1
}
[/block]

\##setLimits

Sets the maximum number of threads, and a maximum number of messages per thread, which will be synchronized. Limits only apply when the synchronization mode is set to Limited.

  **Syntax:** ` void setLimits(int maxThreads, int maxMessagesPerThread)`

**Parameters**

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Type",
    "h-2": "Description",
    "0-0": "maxThreads",
    "1-0": "maxMessagesPerThread",
    "0-2": "The maximum number of threads that will be synchronized",
    "1-2": "The maximum number of messages per thread that will be synchronized",
    "0-1": "int",
    "1-1": "int"
  },
  "cols": 3,
  "rows": 2
}
[/block]