Skip to content

Commit

Permalink
Revert "Increase max size of a message to 1MB. Fixes #24"
Browse files Browse the repository at this point in the history
This reverts commit b4f45dd.
  • Loading branch information
alrod committed Sep 30, 2019
1 parent b4f45dd commit ab9a566
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ internal class EventHubAsyncCollector : IAsyncCollector<EventData>

private const int BatchSize = 100;

// Suggested to use 1008k instead of 1024k to leave padding room for headers.
private const int MaxByteSize = 1008 * 1024;
// Suggested to use 240k instead of 256k to leave padding room for headers.
private const int MaxByteSize = 240 * 1024;

/// <summary>
/// Create a sender around the given client.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public async Task FlushAfterSizeThreshold()
{
var collector = new TestEventHubAsyncCollector();

// Trip the 1024k EventHub limit.
// Trip the 256k EventHub limit.
for (int i = 0; i < 10; i++)
{
var e1 = new EventData(new byte[10 * 1024]);
Expand All @@ -106,7 +106,7 @@ public async Task FlushAfterSizeThreshold()
Assert.Empty(collector.SentEvents);

// This will push it over the theshold
for (int i = 0; i < 100; i++)
for (int i = 0; i < 20; i++)
{
var e1 = new EventData(new byte[10 * 1024]);
await collector.AddAsync(e1);
Expand All @@ -120,8 +120,8 @@ public async Task CantSentGiantEvent()
{
var collector = new TestEventHubAsyncCollector();

// event hub max is 1024k payload.
var hugePayload = new byte[1100 * 1024];
// event hub max is 256k payload.
var hugePayload = new byte[300 * 1024];
var e1 = new EventData(hugePayload);

try
Expand Down

0 comments on commit ab9a566

Please sign in to comment.