Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessageDeliveryException thrown when using AMQP backed channel with Brixton.SR7 and Camden #523

Closed
pilif42 opened this issue Feb 17, 2017 · 16 comments
Labels

Comments

@pilif42
Copy link

pilif42 commented Feb 17, 2017

I am using an AMQP backed channel with Spring Boot 1.4.4.RELEASE and spring-cloud-dependencies. Up to Brixton.SR6, everything is working fine. The only thing I change in my project is Brixton.SR6 to Brixton.SR7 (note that I tried all Camden versions as well and I experienced the same issue) and I start getting:

org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Listener threw exception at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.wrapToListenerExecutionFailedExceptionIfNeeded(AbstractMessageListenerContainer.java:873)
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:783)

Full details of the stack trace can be found at http://stackoverflow.com/questions/42277170/messagedeliveryexception-thrown-when-using-amqp-backed-channel-with-brixton-sr7

My payload is a serializable object and with debug on (in both cases, ie Brixton.SR6 and Brixton.SR7, I can see: o.s.messaging.MessageHeaders : Ignoring non-serializable message headers: [currentSpan, X-Current-Span]

The message I am trying to send to Action.FieldBackup can be seen below:

o.s.i.amqp.channel.PollableAmqpChannel   : preSend on channel 'Action.FieldBackup', message: GenericMessage [payload=uk.gov.ons.ctp.response.action.message.instruction.ActionInstruction@2868ea3c, headers={amqp_receivedDeliveryMode=PERSISTENT, amqp_receivedExchange=action-outbound-exchange, amqp_deliveryTag=394, X-Message-Sent=true, amqp_redelivered=true, messageSent=true, spanTraceId=15090187c236028f, spanId=8eff5c3a7c511e5b, amqp_receivedRoutingKey=Action.Field.binding, X-B3-SpanId=8eff5c3a7c511e5b, currentSpan=[Trace: 15090187c236028f, Span: 8eff5c3a7c511e5b, Parent: 15090187c236028f, exportable:false], X-B3-Sampled=0, X-B3-TraceId=15090187c236028f, id=8e4b81b8-17d0-1d15-d961-fe2b4d0e9cf5, amqp_consumerTag=amq.ctag-EXgeAZXQ5fGy8fUdHPdapQ, X-Current-Span=[Trace: 15090187c236028f, Span: 8eff5c3a7c511e5b, Parent: 15090187c236028f, exportable:false], spanSampled=0, contentType=text/xml, timestamp=1487262992385}]

My xml configuration can be found in the stackoverflow question as well.

If you need more details, I can put my full project code on github for you to have a look and replicate quickly.

@marcingrzejszczak
Copy link
Contributor

Related to #520

@marcingrzejszczak
Copy link
Contributor

If there would a possible for you to provide a sample project then it would be great!

@pilif42
Copy link
Author

pilif42 commented Feb 17, 2017

The main project is available at https://github.com/pilif42/kirona-drs-gateway . You will need to build first https://github.com/pilif42/common and also https://github.com/pilif42/actionsvc-api . Then build the main project, have a RabbitMQ installed and run. To replicate the issue, put messages on the queue Action.Field with: curl -H "Accept: application/json" -H "X-B3-TraceId: 73b62c0f90d11e01" -H "X-B3-SpanId: 73b62c0f90d11e10" http://localhost:8131/kironaTest/loadqueue/1/ai/10/ar/valid/true -v -X POST

You will see that if you run with Brixton.SR6, it will work fine. With Brixton.SR7, you will get the exception.

@marcingrzejszczak
Copy link
Contributor

@pilif42 I can't currently test your sample so maybe you could help me? Could you please check out issues_#520_message_serializable branch, build it ./mvnw clean install -DskipTests -T 8 and try to run your sample with Camden.BUILD-SNAPSHOT ?

@pilif42
Copy link
Author

pilif42 commented Feb 21, 2017

OK. I will do this now and come back to you asap.

@marcingrzejszczak
Copy link
Contributor

Have you managed to check it out @pilif42 ? I've only just fixed the branch (I thought it was updated already)

@pilif42
Copy link
Author

pilif42 commented Feb 21, 2017

I have just done a new pull. I will rebuild and test. I am having issues with my maven build as it does not seem to find the new sleuth .jars despite them being in my local repository. I will post a comment once I have managed to confirm it is fixed.

@pilif42
Copy link
Author

pilif42 commented Feb 21, 2017

The error I am getting is [ERROR] Non-resolvable import POM: Could not find artifact org.springframework.cloud:spring-cloud-dependencies:pom:Camden.BUILD-SNAPSHOT @ line 42, column 25

I have checked and there is no pom in my local repo for Camden.BUILD-SNAPSHOT (I built using the ./mvnw clean install -DskipTests -T 8). For Brixtion.SR6, I can see spring-cloud-dependencies-Brixton.SR6.pom. For the Camden.BUILD-SNAPSHOT, I can only see: spring-cloud-dependencies-Camden.BUILD-SNAPSHOT.pom.lastUpdated . Should I build your project differently?

@marcingrzejszczak
Copy link
Contributor

Have you set up the project like this - http://projects.spring.io/spring-cloud/ ? Check the Camden SNAPSHOT version.

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.4.4.RELEASE</version>
</parent>
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>Camden.BUILD-SNAPSHOT</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
<dependencies>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-sleuth</artifactId>
    </dependency>
</dependencies>
<repositories>
    <repository>
        <id>spring-snapshots</id>
        <name>Spring Snapshots</name>
        <url>https://repo.spring.io/libs-snapshot</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>

@pilif42
Copy link
Author

pilif42 commented Feb 21, 2017

I have now been able to build having in my pom:

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Camden.BUILD-SNAPSHOT</version>
<scope>import</scope>
</dependency>

Note that I have removed the <type>pom</type>

And I also have:

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zipkin</artifactId>
<version>1.1.3.BUILD-SNAPSHOT</version>
</dependency>

For some reasons, it insist on me having the version specified.

Unfortunately, I am still getting the error: Caused by: java.io.NotSerializableException: org.springframework.messaging.support.MessageHeaderAccessor

@marcingrzejszczak
Copy link
Contributor

marcingrzejszczak commented Feb 21, 2017

Can you update the formatting cause somethings didn't manage to get pasted properly as far as I see.

And ensure that you've pulled the latest changes from the branch

@pilif42
Copy link
Author

pilif42 commented Feb 21, 2017

I have updated my formatting. I am trimming my sample project right to the bear minimum. When it is done, I will email you the github location.

@marcingrzejszczak
Copy link
Contributor

Awesome! Thanks

@artembilan
Copy link
Contributor

To be honest, this duplicates the #520, not just relates.
See SO discussion: http://stackoverflow.com/questions/42277170/messagedeliveryexception-thrown-when-using-amqp-backed-channel-with-brixton-sr7.

That was my fault do not mention GH issue there.

Feel free to close in favor of that.

@pilif42
Copy link
Author

pilif42 commented Feb 21, 2017

Sorry it took some time but I had to complete some other work before. The first step is to clone https://github.com/pilif42/common and build it. Then clone https://github.com/pilif42/actionsvc-api and build it. Then clone https://github.com/pilif42/projectTotestSleuthDefect, build and run it. It is checked in with Brixton.SR6 so it will work. If you check the README, I have added a section on how to replicate the defect. Let me know if you encounter any problem replicating.

@marcingrzejszczak
Copy link
Contributor

@pilif42 we'll close this one in favour of #520

marcingrzejszczak added a commit that referenced this issue Feb 23, 2017
this issue is there in core of Spring Framework  (https://jira.spring.io/browse/SPR-15262) but this tests shows how to apply a workaround to get ridd of that problem until we bump up version of SF.

related to #520 and #523
SO - http://stackoverflow.com/questions/42277170/messagedeliveryexception-thrown-when-using-amqp-backed-channel-with-brixton-sr7

fixes #520
marcingrzejszczak added a commit that referenced this issue Feb 23, 2017
this issue is there in core of Spring Framework  (https://jira.spring.io/browse/SPR-15262) but this tests shows how to apply a workaround to get ridd of that problem until we bump up version of SF.

related to #520 and #523
SO - http://stackoverflow.com/questions/42277170/messagedeliveryexception-thrown-when-using-amqp-backed-channel-with-brixton-sr7

fixes #520
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants