It’s probably not JSON. 

Did you print what comes from the base64?

---
R.I.Pienaar

> On 21 Jan 2018, at 16:23, [email protected] wrote:
> 
> I tried with the method which you suggested and getting below error when 
> consumer is trying to consume the message.
> 
> 'utf-8' codec can't decode byte 0x9a in position 0: invalid start byte
> 
> Any idea please.
> 
> 
>> On Sunday, January 21, 2018 at 6:52:57 PM UTC+5:30, [email protected] wrote:
>> The data is not corrupted, since I was able to get the data using Ruby by 
>> importing mcollective and using native mcollective decode. 
>> 
>> And this what the code I tried in Python,
>> 
>> def run(self):
>>     client = Stomp(self.config)
>>     yield client.connect()
>>     headers = {StompSpec.ACK_HEADER: StompSpec.ACK_CLIENT_INDIVIDUAL, 
>> 'activemq.prefetchSize': '10000'}
>>     client.subscribe(self.QUEUE, headers,
>>                      listener=SubscriptionListener(self.consume, 
>> errorDestination=self.ERROR_QUEUE))
>> 
>> def consume(self, client, frame):
>>     data = json.loads(base64.b64decode(frame.body))
>>     print(data)
>>     
>> 
>> 
>> 
>> 
>>> On Sunday, January 21, 2018 at 4:33:24 PM UTC+5:30, R.I.Pienaar wrote:
>>> 
>>> 
>>> On Sun, 21 Jan 2018, at 10:50, [email protected] wrote: 
>>> > Hi, 
>>> > 
>>> > Am trying to use different consumer which can consume messages which is 
>>> > being called with reply-to option and the consumer which am trying to use 
>>> > is stompest (https://github.com/nikipore/stompest) which is Python based. 
>>> > Am able to configure this and its receiving the message but unable to 
>>> > decode the message using base64. Am not using any security plugin in my 
>>> > mcollective environment so I hope MCollective does plain base64 encoding 
>>> > only, so with that I tried to decode the message in Python using same 
>>> > base64 but its not working. Sometimes getting "Incorrect Padding" issue 
>>> > and 
>>> > sometimes byte related errors are appearing. So looking proper way to 
>>> > decode the mcollective message using python and get the message payload 
>>> > data. 
>>> > 
>>> 
>>> padding error means some data at the end is missing - often normal - base64 
>>> data has to be dividable by 4, if not add "=" at the end till it is.  Then 
>>> it should work 
>>> 
>>> not sure what happens that your data is corrupt though 
>>> 
>>> -- 
>>> R.I.Pienaar / www.devco.net / @ripienaar 
> 
> -- 
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "mcollective-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"mcollective-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to