Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: microsoft/AzureNetworkWatcherNSGFlowLogsConnector
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: sagar027/AzureNetworkWatcherNSGFlowLogsConnector
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Sep 27, 2019

  1. Fix eventhub message size

    sagar027 committed Sep 27, 2019
    Copy the full SHA
    e732415 View commit details
Showing with 23 additions and 2 deletions.
  1. +23 −2 NwNsgProject/Util.cs
25 changes: 23 additions & 2 deletions NwNsgProject/Util.cs
Original file line number Diff line number Diff line change
@@ -184,9 +184,30 @@ static IEnumerable<List<DenormalizedRecord>> denormalizedRecords(string newClien
innerFlow.mac,
tuple);

var sizeOfDenormalizedRecord = denormalizedRecord.GetSizeOfJSONObject();
var sizeOfDenormalizedRecord = denormalizedRecord.GetSizeOfJSONObject();

if (sizeOfListItems + sizeOfDenormalizedRecord > MAXTRANSMISSIONSIZE + 20)
//for Event hub binding fork -- start
// Event hub basic message size is 256KB and the 'if' statement below ensures that list does not exceed size this size for Eventhub

string outputBinding = Util.GetEnvironmentVariable("outputBinding");

if (outputBinding == "eventhub")
{
if (sizeOfListItems > 120) // this will chunk below 256KB : this is ideal sample message size. Feel free to go maximum till 150 : smaller values will create lot of outbound connections.
{
yield return outgoingList;
outgoingList.Clear();
sizeOfListItems = 0;
}
outgoingList.Add(denormalizedRecord);
sizeOfListItems += 1;

}

//for Event hub binding fork -- end
//other output bindings

else if (sizeOfListItems + sizeOfDenormalizedRecord > MAXTRANSMISSIONSIZE + 20)
{
yield return outgoingList;
outgoingList.Clear();