2

I'm trying to use Spring Integration with Amazon SQS, but can't figure out what I'm doing wrong.

If I use an in-memory queue as below, everything works fine:

<channel id="businessEvents">
    <queue />
</channel>

But when I changed it to use AWS SQS as below:

<int-sqs:channel id="businessEvents" 
    region-id="us-east-1"
    queue-name="events-sqs" 
    aws-credentials-provider="awsCredentialsProvider"  />

I get the following error:

org.springframework.integration.MessagingException: org.springframework.integration.MessagingException: No serializer found for class br.com.event.RegisterEvent and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: org.springframework.integration.aws.["payload"])

Do I need to configure anything else on Spring Integration? Or is it something wrong in my bean class?

June
  • 592
  • 8
  • 18
  • can u pls post the code for the class `br.com.event.RegisterEvent`. Have you implemented `Serializable`? – Jos Jul 27 '15 at 20:19
  • Hi @redflar3, the class is a bit long, but yes, it implements Serializable. The curious thing is it fails on a "payload" property. I think "payload" is from Spring Integration itself. – June Jul 27 '15 at 20:26

2 Answers2

0

SerializationConfig.Feature ...

It looks like you are somehow invoking JSON serialization (Jackson) and your class is not Jackson-friendly.

Please show the full stack trace when asking questions like this.

Gary Russell
  • 166,535
  • 14
  • 146
  • 179
0

Figured this out. We annotated our events (that went to the queue), with @JsonProperty as below:

@com.fasterxml.jackson.annotation.JsonProperty
private long createdAt;

But when we use String Integration AWS, we need to use @JsonProperty from another package.

@org.codehaus.jackson.annotate.JsonProperty
private long createdAt;
June
  • 592
  • 8
  • 18