我的任务是记录我们将如何使用 Azure DevOps。这对我们团队来说是新鲜事。
我正在为各种 How Tos、指南、标准等创建一个 wiki。
我想强制用户按特定顺序阅读页面。但我不一定希望他们直接进入树中的页面。
这是我的结构
因此,对于 Repos,如果读者需要将现有的 git 存储库迁移到 Azure DevOps,我想阅读
但我不希望这些页面在树中可见。我将有另一个页面包含这些页面的链接。
这可能吗?我的研究并没有带来多少帮助。
我正在评估 Quakus 作为 Tomcat 环境的替代品。我了解我正在尝试做的事情所面临的挑战,但我首先需要验证我现有的遗留 JSP 应用程序是否可以使用 Quarkus 运行。我使用 quarkus.undertow 作为我的 servlet 容器。
到目前为止我已经克服了几个障碍。我现在遇到的问题是如何使用我的数据源。
目前,我们的数据源在 Tomcat 的 server.xml 中设置为 GlobalNamingResources,并将它们绑定在 Web 应用程序的 META-INF/context.xml 中作为 ResourceLinks。
我已将数据源设置转移到 Quarkus 的 application.properties,如下所示:
quarkus.datasource.menudb.url=jdbc:mysql://some.server.url/menuadmin
quarkus.datasource.menudb.driver=com.mysql.cj.jdbc.Driver
quarkus.datasource.menudb.username=web
quarkus.datasource.menudb.password=<password>
Run Code Online (Sandbox Code Playgroud)
我从文档中了解到,这就是执行此操作的方法。但是,文档随后显示了注入数据源:
@Inject
@DataSource("users")
AgroalDataSource dataSource1;
Run Code Online (Sandbox Code Playgroud)
就我而言,我将替换注释中的users数据源名称。menudb但是,我需要能够重用数据访问类来创建 InitialContext、使用传入的 JNDI 资源名称查找数据源并创建数据源:
InitialContext ic = new InitialContext();
DataSource ds = (DataSource)ic.lookup("java:comp/env/<jndi name>");
conn = ds.getConnection();
Run Code Online (Sandbox Code Playgroud)
这会导致以下错误:
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application …Run Code Online (Sandbox Code Playgroud) 到目前为止,我已经在 Quarkus 中使用 Smallrye Mutiny 做了非常基本的事情。基本上,我有一两个非常小的 Web 服务,它们仅与 Web 应用程序交互。这些服务返回一个Uni<Response>.
现在我正在编写一个日志服务,我希望其他人向其传递信息。在此日志记录服务中,我需要返回一个值来调用服务。日志记录服务将返回该值作为Uni<Integer>. 我正在努力解决的是如何将调用服务中的返回值提取为int.
这是日志服务中的函数
@GET
@Path("/requestid")
@Produces(MediaType.TEXT_PLAIN)
public Uni<Integer> getMaxRequestId(){
return service.getMaxRequestId();
}
public Uni<Integer> getMaxRequestId() {
Integer result = Integer.valueOf(em.createQuery("select MAX(request_id) from service_requests").getFirstResult());
if(result == null) {
result = 0;
}
return Uni.createFrom().item(result += 1);
}
Run Code Online (Sandbox Code Playgroud)
这是调用服务中的客户端代码
@Path("/requests")
public class RequestIdResource {
@RestClient
RequestIdServices service;
@GET
@Path("/requestid")
@Produces(MediaType.TEXT_PLAIN)
public Uni<Integer> getMaxRequestId(){
return service.getMaxRequestId();
}
}
public void filter(ContainerRequestContext requestContext) throws IOException {
int requestid …Run Code Online (Sandbox Code Playgroud)