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

PayloadApplicationEvent can't hit cache [SPR-13543] #18119

Closed
spring-projects-issues opened this issue Oct 6, 2015 · 2 comments
Closed

PayloadApplicationEvent can't hit cache [SPR-13543] #18119

spring-projects-issues opened this issue Oct 6, 2015 · 2 comments
Assignees
Labels
in: core type: bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Oct 6, 2015

bohr.qiu opened SPR-13543 and commented

PayloadApplicationEvent dont implement hashcode and equals,when publish event,org.springframework.context.event.AbstractApplicationEventMulticaster#getApplicationListeners(org.springframework.context.ApplicationEvent, org.springframework.core.ResolvableType) method can’t hit the cache。

cache key is ListenerCacheKey,


Affects: 4.2.1

Issue Links:

  • #18116 OutOfMemory Exception when publishing User Events
@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 6, 2015

bohr.qiu commented

test code listener :

@EventListener
public void handle(PoEvent poEvent) {
logger.info("{}", poEvent);
}

public static class PoEvent {
    private String msg;

    public PoEvent(String msg) {
        this.msg = msg;
    }
}

publish:

@Test
public void testPublish() throws Exception {
publisher.publishEvent(new EventListeners.PoEvent("xxxx"));
publisher.publishEvent(new EventListeners.PoEvent("xxxx"));
}

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 6, 2015

Juergen Hoeller commented

This seems to be a variant of #18116, which has been addressed already. Please give the latest 4.2.2.BUILD-SNAPSHOT a try...

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core type: bug
Projects
None yet
Development

No branches or pull requests

2 participants