Use default phase 0 for WebSocket messaging

Closes gh-27519
This commit is contained in:
rstoyanchev
2024-05-21 15:49:28 +01:00
parent d5c7a5e2db
commit 8c9b6e2205
8 changed files with 24 additions and 14 deletions

View File

@@ -276,7 +276,8 @@ public class SimpAnnotationMethodMessageHandler extends AbstractMethodMessageHan
/**
* Set the phase that this handler should run in.
* <p>By default, this is {@link SmartLifecycle#DEFAULT_PHASE}.
* <p>By default, this is {@link SmartLifecycle#DEFAULT_PHASE}, but with
* {@code @EnableWebSocketMessageBroker} configuration it is set to 0.
* @since 6.1.4
*/
public void setPhase(int phase) {

View File

@@ -202,7 +202,8 @@ public abstract class AbstractBrokerMessageHandler
/**
* Set the phase that this handler should run in.
* <p>By default, this is {@link SmartLifecycle#DEFAULT_PHASE}.
* <p>By default, this is {@link SmartLifecycle#DEFAULT_PHASE}, but with
* {@code @EnableWebSocketMessageBroker} configuration it is set to 0.
* @since 6.1.4
*/
public void setPhase(int phase) {

View File

@@ -28,7 +28,6 @@ import org.springframework.beans.factory.BeanInitializationException;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.SmartLifecycle;
import org.springframework.context.annotation.Bean;
import org.springframework.context.event.SmartApplicationListener;
import org.springframework.lang.Nullable;
@@ -197,7 +196,7 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC
}
protected int initPhase() {
return SmartLifecycle.DEFAULT_PHASE;
return 0;
}
/**

View File

@@ -159,7 +159,8 @@ public class UserDestinationMessageHandler implements MessageHandler, SmartLifec
/**
* Set the phase that this handler should run in.
* <p>By default, this is {@link SmartLifecycle#DEFAULT_PHASE}.
* <p>By default, this is {@link SmartLifecycle#DEFAULT_PHASE}, but with
* {@code @EnableWebSocketMessageBroker} configuration it is set to 0.
* @since 6.1.4
*/
public void setPhase(int phase) {