I have created python script which is uploaded as a zip file in AWS Lambda function with stompy libraries bundled in them.
Logs for python 2.7:-
Response:
nullRequest ID:
"c334839f-ee46-11e8-8970-612f1dc92e41"Function Logs:
START RequestId: c334839f-ee46-11e8-8970-612f1dc92e41 Version: $LATEST
CONNECTION Started
CONNECTION established
CONNECTION Subscribed
[WARNING] 2018-11-22T11:07:12.798Z c334839f-ee46-11e8-8970-612f1dc92e41 Unknown response frame type: '' (frame length was 3)
END RequestId: c334839f-ee46-11e8-8970-612f1dc92e41
REPORT RequestId: c334839f-ee46-11e8-8970-612f1dc92e41 Duration: 10027.75 ms Billed Duration: 10100 ms Memory Size: 128 MB Max Memory Used: 30 MB
My Code:-
import time
import boto3
import stompkinesis_client = boto3.client('kinesis')class Listener(stomp.ConnectionListener):msg_list = []def on_error(self, headers, message):print('received an error "%s"' % message)def on_message(self, headers, message):print('received a message "%s"' % message)kinesis_client.put_record(StreamName='Purchasing',Data=u'{}\r\n'.format(message).encode('utf-8'),PartitionKey='0')def lambda_handler(event, context):conn = stomp.Connection(host_and_ports=[('b-4714-4441-8166-47aae158281a-1.mq.eu-central-1.amazonaws.com', 8162)])lst = Listener()conn.set_listener('Listener', Listener())conn.start()conn.connect(login='test_mq', passcode='test_mq')conn.subscribe(destination='/queue/Purchasing', id='b-4714-4441-8166-47aae158281a', ack='auto')message = lst.msg_listprint('Waiting for messages "%s"' % message)time.sleep(10)conn.disconnect()return ''
I am not sure why my message is not showing up in my output,instead it always shows up "Response: null".