小编Ste*_*nia的帖子

JMS主题生存时间

我正在开发一个由一些模块组成的应用程序.在其中一个模块中,有人创建了一个主题生成器,用于发布关于主题的消息,但是该模块没有主题消费者来使消息出列.主题生产者使用生存时间属性设置为300000毫秒setTimeToLive().

我希望如果没有消费者,消息将在300000毫秒内到期,并且它们将被解除分配.

该应用程序部署在Tomcat 6.0.36上,它使用外部ActiveMQ服务器来处理队列和主题.

在主题设置下的MBeans选项卡中使用Java VisualVM监视ActiveMQ我看到变量"Enqueue Count"增长,但我不明白生存时间设置是否对这些消息生效.我希望看到计数器"ExpiredCount"增加,但它仍然固定为0.

有没有办法了解这些消息是否仍然留在内存中或者是否已取消分配?

非常感谢你!

编辑:

我使用netbeans 7.3上的j2ee教程示例进行了一些测试,使用内部glassfish 3.1作为服务器,使用jvisualvm进行监控,所有工作如api所说:

JMS API不提供浏览主题的机制.消息一出现就会从主题中消失:如果没有消息消费者使用它们,则JMS提供程序会删除它们.虽然持久订阅允许消息保留在主题上,但消息使用者不活动时,不存在检查它们的工具.

我读到glassfish在activeMQ中使用,所以我希望这对于独立的ActiveMQ服务器也是有效的.

结束编辑.

java tomcat activemq-classic jms web

6
推荐指数
1
解决办法
1万
查看次数

Spring Boot身份验证-管理控制台403对客户端的响应

我正在使用jdk 1.8和Spring Boot 2.1.2。

我想在Spring Boot的管理控制台及其客户端中启用身份验证。

我在管理 application.properties中设置:

spring.security.user.name=admin
spring.security.user.password=secret

spring.boot.admin.discovery.enabled=true

management.endpoints.web.exposure.include=*
management.endpoints.web.cors.allowed-methods=GET,POST
Run Code Online (Sandbox Code Playgroud)

管理项目中,我添加了此类:

@EnableWebSecurity
@Configuration
public class SecuritySecureConfig extends WebSecurityConfigurerAdapter {

    private static final Logger logger = (Logger) LoggerFactory.getLogger(SecuritySecureConfig.class);

    private final String adminContextPath;

    public SecuritySecureConfig(AdminServerProperties adminServerProperties) {
        this.adminContextPath = adminServerProperties.getContextPath();
    }

    @Override
protected void configure(HttpSecurity http) throws Exception {

    SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
    successHandler.setTargetUrlParameter("redirectTo");
    successHandler.setDefaultTargetUrl(adminContextPath + "/");

    http.authorizeRequests()
            .antMatchers(adminContextPath + "/assets/**").permitAll()
            .antMatchers(adminContextPath + "/login").permitAll()
            .anyRequest().authenticated()
            .and()
            .formLogin().loginPage(adminContextPath + "/login").successHandler(successHandler).and()
            .logout().logoutUrl(adminContextPath + "/logout").and()
            .httpBasic().and()
            .csrf() …
Run Code Online (Sandbox Code Playgroud)

java maven spring-boot spring-boot-admin

5
推荐指数
1
解决办法
493
查看次数

Oracle 数据库链接出错

我正在尝试创建一个从 Oracle 服务器到另一个的数据库链接。我使用的命令是:

 create public database link mylink connect to myuser identified by 0000 authenticated by myuser identified by 0000 using 'myTNSNameRemoteServer';
Run Code Online (Sandbox Code Playgroud)

sqlplus 给我这个错误:

ERROR at line 1:
ORA-00933: SQL command not properly ended
Run Code Online (Sandbox Code Playgroud)

在第一个实例中将“*”放在密码的第一个字符下。

我必须以某种方式逃避它吗?

谢谢

oracle11g

2
推荐指数
1
解决办法
5569
查看次数