Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

ServerlessApplicationListener adjust Ordered #256

Merged
merged 2 commits into from
Nov 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@
import org.springframework.boot.context.event.ApplicationStartingEvent;
import org.springframework.boot.context.event.SpringApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.core.Ordered;

import static com.alipay.sofa.ark.spi.constant.Constants.PLUGIN_EXPORT_CLASS_ENABLE;

/**
* @author: yuanyuan
* @date: 2023/10/30 9:38 下午
*/
public class ServerlessApplicationListener implements ApplicationListener<SpringApplicationEvent> {
public class ServerlessApplicationListener implements ApplicationListener<SpringApplicationEvent>,
Ordered {

@Override
public void onApplicationEvent(SpringApplicationEvent event) {
Expand All @@ -41,4 +43,12 @@ public void onApplicationEvent(SpringApplicationEvent event) {
}
}
}

/**
* 优先级要高于 ArkApplicationStartListener 否则,会提前进入 ark 1.0 分支
*/
@Override
public int getOrder() {
return Ordered.HIGHEST_PRECEDENCE + 100;
}
}