rajinders / nlog-targets-azureeventhub Goto Github PK
View Code? Open in Web Editor NEWNLog Target for Azure ServiceBus EventHub
License: Apache License 2.0
NLog Target for Azure ServiceBus EventHub
License: Apache License 2.0
AzureEventHubTarget implements IDisposable, but does not do anything when the object is disposed. It should be freeing up the resources related to the event hub client.
If a communication error occurs when a message is submit to Azure Event Hub the error is ignored and the log message lost.
The issue is that Write() starts a new task, but does not wait for it to complete.
What format is this serializing the events with? It looks like it's not JSON? Trying to apply stream analytics and as best I can tell the code is just taking the raw rendered layout string and not parsing it.
According to this comment for the PartitionKey property the key should be distributed evenly using round robin if no partition key is set.
/// <summary>
/// PartitionKey is optional. If no partition key is supplied the log messages are sent to eventhub
/// and distributed to various partitions in a round robin manner.
/// </summary>
public string PartitionKey { get; set; }
From what I can see there is, no code doing anything with the key if it is not set?
using (var eventHubData = new EventData(Encoding.UTF8.GetBytes(logMessage)) { PartitionKey = partitionKey })
{
foreach (var key in logEvent.Properties.Keys)
{
eventHubData.Properties.Add(key.ToString(), logEvent.Properties[key]);
}
await _eventHubClient.SendAsync(eventHubData);
return true;
}
As such the behaviour defaults back to whatever the SendAsync method does with a blank partition key.
According to the MSDN documentation it must have the partitionkey set.
Remarks
Any EventData instance send operation using this method must have the PartitionKey set.
In our case this leads to that we are only writing to one of the partitions all the time since the partitionkey is not changing and thus all scale advantages with the eventhub is gone.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.