public static int getDataSerializedSize ( Message amqpMessage ) { if ( amqpMessage == null ) { return 0 ; } int payloadSize = getPayloadSize ( amqpMessage ) ; // EventData - accepts only PartitionKey - which is a String & stuffed into MessageAnnotation MessageAnnotations messageAnnotations = amqpMessage . getMessageAnnotations ( ) ; ApplicationProperties applicationProperties = amqpMessage . getApplicationProperties ( ) ; int annotationsSize = 0 ; int applicationPropertiesSize = 0 ; if ( messageAnnotations != null ) { annotationsSize += Util . sizeof ( messageAnnotations . getValue ( ) ) ; } if ( applicationProperties != null ) { applicationPropertiesSize += Util . sizeof ( applicationProperties . getValue ( ) ) ; } return annotationsSize + applicationPropertiesSize + payloadSize ; }
Remove this .. Too many cases too many types ...