--- title: "Get Message Count" slug: "get-message-count" tags: ["message service", "message queue"] updated: 2023-01-09T21:13:01Z published: 2023-01-09T21:13:01Z canonical: "documentation.decisions.com/get-message-count" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt > Use this file to discover all available pages before exploring further. # Get Message Count | ## Step Details | | --- | | **Introduced in Version** | 4.0.0 | | **Last Modified in Version** | 8.0.0 | | **Location** | Integration > Message Queues | The **Get Message Count** step is used to retrieve and return the total count of all messages within a queue. The step will output an Int64 value. --- ## Properties #### Outputs | Property | Description | Data Type | | --- | --- | --- | | Message Count | The total count of messages for the specified queue | Int64 | #### ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1671480132122.png) --- ## Common Errors ### Missing Queue selection If a [message queue](https://documentation.decisions.com/docs/about-messaging) is not selected under the SETTINGS category for the step, the step will throw an error. Ensure that a queue has been selected before running the step. #### Exception Message: ```cpp Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Get Message Count 1[GetMessageCount] in flow [Testing]: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DecisionsFramework.Data.Messaging.MessageServerEndpoint.GetQueueByName(String queueName) at DecisionsFramework.Data.Messaging.MessagingService.GetQueueByName(String queueName) at DecisionsFramework.Data.Messaging.BaseMessagingStep.GetQueue(StepStartData stepData) at DecisionsFramework.Data.Messaging.GetMessageCount.Run(StepStartData data) at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData) at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData) --- End of inner exception stack trace --- ``` --- Related Information Forum Posts: [Get Message from Message Queue](https://support.decisions.com/forum/topic309-get-message-from-message-queue.aspx) ## Related - [Get Message](/get-message-steps.md) - [Get String Message](/get-string-message.md)