-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: queue message payloads (#20749)
* feat: queue message payloads Add sent payloads to message queue and resend if no response to message inside MaxMessageSuspendTimeout fixes #20507 * Add test for re-request Fix queued message send timing. * fix test server response format server * Make custom service simpler Fix concurrent issue with custom uidl handler. * use the has method clear queue for push messaging. * Do not up clientId for message already containing clientId * cleanup
- Loading branch information
Showing
12 changed files
with
461 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<artifactId>flow-tests</artifactId> | ||
<groupId>com.vaadin</groupId> | ||
<version>24.7-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>flow-client-queue-test</artifactId> | ||
<name>Test Flow client queue</name> | ||
|
||
<packaging>war</packaging> | ||
<properties> | ||
<maven.deploy.skip>true</maven.deploy.skip> | ||
<!-- Test checks client log so java.util.logging.Level import is needed --> | ||
<enforcer.skip>true</enforcer.skip> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>flow-test-resources</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>vaadin-dev-server</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>flow-html-components-testbench</artifactId> | ||
<version>${project.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<!-- Run flow plugin to build frontend --> | ||
<plugin> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>flow-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>prepare-frontend</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<!-- <configuration>--> | ||
<!-- <frontendHotdeploy>true</frontendHotdeploy>--> | ||
<!-- </configuration>--> | ||
</plugin> | ||
<!-- Run jetty before integration tests, and stop after --> | ||
<plugin> | ||
<groupId>org.eclipse.jetty.ee10</groupId> | ||
<artifactId>jetty-ee10-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
46 changes: 46 additions & 0 deletions
46
flow-tests/test-client-queue/src/main/java/com/vaadin/flow/misc/ui/CustomService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright 2000-2025 Vaadin Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
package com.vaadin.flow.misc.ui; | ||
|
||
import java.util.List; | ||
|
||
import com.vaadin.flow.function.DeploymentConfiguration; | ||
import com.vaadin.flow.server.RequestHandler; | ||
import com.vaadin.flow.server.ServiceException; | ||
import com.vaadin.flow.server.VaadinServlet; | ||
import com.vaadin.flow.server.VaadinServletService; | ||
import com.vaadin.flow.server.communication.UidlRequestHandler; | ||
|
||
public class CustomService extends VaadinServletService { | ||
|
||
public CustomService(VaadinServlet servlet, | ||
DeploymentConfiguration deploymentConfiguration) { | ||
super(servlet, deploymentConfiguration); | ||
} | ||
|
||
@Override | ||
protected List<RequestHandler> createRequestHandlers() | ||
throws ServiceException { | ||
List<RequestHandler> requestHandlers = super.createRequestHandlers(); | ||
requestHandlers.replaceAll(handler -> { | ||
if (handler instanceof UidlRequestHandler) { | ||
return new CustomUidlRequestHandler(); | ||
} | ||
return handler; | ||
}); | ||
return requestHandlers; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
flow-tests/test-client-queue/src/main/java/com/vaadin/flow/misc/ui/CustomServlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 2000-2024 Vaadin Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
package com.vaadin.flow.misc.ui; | ||
|
||
import jakarta.servlet.annotation.WebServlet; | ||
|
||
import com.vaadin.flow.function.DeploymentConfiguration; | ||
import com.vaadin.flow.server.ServiceException; | ||
import com.vaadin.flow.server.VaadinServlet; | ||
import com.vaadin.flow.server.VaadinServletService; | ||
|
||
@WebServlet(urlPatterns = "/*", asyncSupported = true) | ||
public class CustomServlet extends VaadinServlet { | ||
|
||
@Override | ||
protected VaadinServletService createServletService( | ||
DeploymentConfiguration deploymentConfiguration) | ||
throws ServiceException { | ||
CustomService service = new CustomService(this, | ||
deploymentConfiguration); | ||
service.init(); | ||
return service; | ||
} | ||
} |
Oops, something went wrong.