aws / aws-lambda-java-libs

Official mirror for interface definitions and helper classes for Java code running on the AWS Lambda platform.
https://aws.amazon.com/lambda/
Apache License 2.0
517 stars 232 forks source link

Questions for java greengrass lambda coding #69

Closed northeusunshine closed 5 years ago

northeusunshine commented 5 years ago

Dear all,

I'm beginner of greengrass core application, and finished the demo setup following greengrass developper guide. but i'm still confusing about how lambda functio works.the bellow is the quesitons I want to ask for help.

I want to run a lambda function in my raspberry pi 3 as greengrass core, which can recieve multiple IoT devices' MQTT messages and do some process according to task tpye(i.e various signal filtering or house-hold machine learning algorithms). After proceesing, I need send the information using MQTT to my own server(not AWS IoT cloud) for higher level processing with some topics.

my questions are as follows( I want to use JAVA language): 1 To receive multiple aws iot devices connected to the GGC, should I need to set up a AWSIoTMQTTClient in aws-iot-device-sdk-java? I also find in aws_greengrass_core_sdk_java, there is “IotDataClient” class,what's it for?and what's the different with AWSIoTMQTTClient. here is really very confusing, even with sdk document description.

2 In GGC, when I deployed my lambda function, will it has an internal MQTT broker to receive messages for AWSIoTMQTTClient ?

3 for lambda functions, after creation and deployment on GGC, will it start to work. I saw there is method to invoke another lambda funciton from a lambda funciton. I don't understand the mechanism how lambda works.

4 Can i have multiple lambda functions for different uage,for instance, one is only to receive MQTT messages, another is to process the received info, other one is to send the processed info out to my own MQTT server? if permitted, how to make the work together to perform all the tasks.

5 I saw there is event input to lambda interface, how can I call a lambda only when some specific topic arriverd to AWSIoTMQTTClient defined in the lambda function?

6 the below is JAVA lambda interface template: outputType handler-name(inputType input, Context context) { ... } i think it should permit user to define input data type as he need. but the quesiton is if I define inputtype is string. how to the lambda handler to receive the string. the development guidence have no clear description.

7 finally, can you please share some demo codes for the above questions?

Thanks for you attention and kind help in advance. your help is highly expected.

tphokas commented 5 years ago

Hi,

Unfortunately the maintainers of this repository are not familiar with aws-iot-device-sdk-java and GGC therefore we are not equipped to answer your questions.

I'd suggest you open this issue either on aws-iot-device-sdk-java repository or try AWS forums?

Apologies we couldn't help further.

northeusunshine commented 5 years ago

Hi, thanks for your advice

Hi,

Unfortunately the maintainers of this repository are not familiar with aws-iot-device-sdk-java and GGC therefore we are not equipped to answer your questions.

I'd suggest you open this issue either on aws-iot-device-sdk-java repository or try AWS forums?

Apologies we couldn't help further.