1

I have converted a video using the AWS Elemental MediaConvert. The video is stored in S3. For this, I am submitting a job from the Java code and it is returning the jobID. I need to write a listener in my code, that listener should be notified when the job is complete.

How can I write a listener in Java for AWS Elemental MediaConvert job?

What components can I use from AWS for this process?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
  • Normally you need to poll for the job status. Maybe you could use the Cloudwatch events https://docs.aws.amazon.com/mediaconvert/latest/ug/cloudwatch_events.html – gusto2 Oct 13 '21 at 06:49
  • @gusto2 cloud watch events source is media convert. what is the target ? can I leave target empty ? can we read cloud events from aws java sdk ? – cseprojects 14batch Oct 13 '21 at 07:03
  • There is a section in the link *Automatically initiate post-processing with an AWS Lambda function*. That's what are you asking - get notified (in this case invoking a lambda fn). What do you do with the event is up to you – gusto2 Oct 13 '21 at 07:09
  • is it possible to read cloud watch events directly from the java code ? – cseprojects 14batch Oct 14 '21 at 08:19
  • it is possible. .. but then it's better to poll for the status of the job. AWS will not "push" any information back to the remote client. The client needs to poll for status or logs or whatever. You asked for a *listeren*, that's working only on the server-side (lambda or CloudWatch Events) – gusto2 Oct 14 '21 at 10:29
  • @gusto2 is it possible to send the cloud watch events to the kafka topic ? – cseprojects 14batch Oct 18 '21 at 06:29

1 Answers1

3

you can do it in the following ways

  1. create a cloud watch rule with source as media convert and destination as a endpoint. that endpoint can receive the status and progress of conversion.

  2. create a cloud watch rule with source as media convert and destination as SQS queue. you can write listener in your java code for SQS queue using the Spring cloud.

saij9999
  • 282
  • 1
  • 3
  • 18