# EventHubQueueCache.TryGetNextMessageWithResult(object, IBatchContainer?)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.streaming.eventhubs/orleans.streaming.eventhubs.eventhubqueuecache/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.streaming.eventhubs/orleans.streaming.eventhubs.eventhubqueuecache/methods/)

[Source](https://github.com/dotnet/orleans/blob/1644940b035c7bdf215a4fd7135757c06bcfe9ec/src/Azure/Orleans.Streaming.EventHubs/Providers/Streams/EventHub/EventHubQueueCache.cs#L193-L199)

```csharp
public QueueCacheCursorMoveResult TryGetNextMessageWithResult(object cursorObj, out IBatchContainer? message)
```

Attempts to get the next message in the cache for the provided cursor.

### Parameters

- `cursorObj` (`object`): The cache cursor.
- `message` (`IBatchContainer?`): The next message when one is available.

### Returns

A successful result with a non-null `message`, [QueueCacheCursorMoveResultKind](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.queuecachecursormoveresultkind/) with a null message, or a cache-miss result with a null message.
