Hello @Vijay Karthik G ,
partitionkeys are used to streamline and scale resources like the iothub and eventhub. Once you have chosen a certain number of partitions (4 by default for an IoT Hub) it's normal to use that same number downstream (like in the evenhub). Otherwise, it acts as a funnel, blocking ingestion.
Normally, 4 partitions should be enough for the majority of customers. See this documentation with background information about choosing the number of partitions.
Regarding the null values, I did a quick experiment.
I created an IoT Hub with 4 partitions:
I also created an eventhub with 4 partitions:
A custom endpoint and route is added to send data to the eventhub:
I send messages from a simulated device:
The Eventhub offers a quick insight into the incoming data using the Process data menu:
Explore:
Here you see the partition key in the query editor:
So technically, the partitioning seems to work out well. Please double-check your code.