# GetSpoolCount

### int GetSpoolCount()

EZGemPlus의 Spool기능사용 시 현재 Spool메모리에 저장 되어있던 메시지의 수.

Spool 기능이 작동하여 저장되었던 메시지의 수를 반환합니다. 이 값은 Host의 요청에 의해 Spool이 비워지기 전까지 유지됩니다.

Return Value

<table data-header-hidden><thead><tr><th width="228" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Value</td><td valign="top">Description</td></tr><tr><td valign="top">0</td><td valign="top">Spool에 저장되었던 메시지가 없음</td></tr><tr><td valign="top">>=1</td><td valign="top">Spool에 저장되었던 메시지 수</td></tr></tbody></table>

```csharp
// 현재 스풀 큐에 쌓인 메시지 개수 확인
    int currentSpoolCount = m_gem.GetSpoolCount();

    if (currentSpoolCount >= 0)
    {
        Console.WriteLine($"현재 스풀링된 메시지: {currentSpoolCount} 개");
        
        // 특정 개수 이상 쌓였을 때 경고 알람 처리 예시
        if (currentSpoolCount > 5000)
        {
            Console.WriteLine("주의: 스풀 데이터가 임계치를 초과하고 있습니다.");
        }
    }
    else
    {
        Console.WriteLine($"스풀 개수 확인 실패. 에러 코드: {currentSpoolCount}");
    }
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nviasoft.gitbook.io/nviasoft-docs/api-reference/spool/getspoolcount.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
