1

I am currently working on an azure function that reads messages from a service bus queue. I am in a testing phase and my service bus queue gets about 50 messages per minute. (in a production environment it would be thousands of data points coming in per minute). When I run my function i get the following error (see error comment in code)

[FunctionName("ReadServiceBusMessage")]
        public static void ProcessMessagesAsync([ServiceBusTrigger("modbusdata", Connection = "test_RootManageSharedAccessKey_SERVICEBUS")]Message message, ILogger log)
        {
            try
            {
                log.LogInformation("Reading the message from queue");
                log.LogInformation("======================================================");

                string itemRaw;

                var data = new MemoryStream(message.Body);

                using (var istr = new InflaterInputStream(data))
                using (var rdr = new StreamReader(istr))
                {
                    itemRaw = rdr.ReadToEnd();//ERROR:ICSharpCode.SharpZipLib.SharpZipBaseException: 'Header checksum illegal'
                }

                log.LogInformation("Message encoding is completed.");
                log.LogInformation("========================================");

To be very honest I cannot find much useful information about what could be going on with this error. The closest I've came to finding a solution is that maybe i'm supposed to deflate the message instead of inflating, or inflating it within my code wont work because I am not working with enough data in the simulated environment. Thanks in advance for any guidance that can be provided.

hfires
  • 113
  • 10
  • This question should not be tagged with `azureservicebus`. It has nothing to do with that service. – Sean Feldman Oct 10 '19 at 22:03
  • What do you suggest I add as a tag? – hfires Oct 10 '19 at 22:07
  • Things that would be related to the problem at hand. The function is not the culprit as your Function is triggered as expected. Messaging is not one of those. You receive the message and you can read the body. At this point, you need to troubleshoot why the body cannot be used with ICSharpCode library. Run it locally and see what happens. If it's not working locally either, then perhaps the payload is constructed incorrectly. Can you compress and decompress w/o using Functions and ServiceBus? I'd start there. – Sean Feldman Oct 10 '19 at 22:14
  • Gotcha. That makes a lot of sense. Thank you. – hfires Oct 10 '19 at 22:16

0 Answers0