小编lio*_*ior的帖子

RabbitMQ:如何创建和恢复备份

我是RabbitMQ的新手,我需要一些帮助.如何备份和恢复到RabbitMQ,以及需要保存的重要数据是什么.

谢谢!

backup rabbitmq

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

通过Spring Data JPA执行批量更新时@Version字段未更新

我正在使用弹簧数据存储库,我有一个问题,我无法找到答案.我的存储库查询是:

@Modifying
@Query("UPDATE User u SET u.firstName = 'blabla' WHERE u.loginName = 'admin'")
public int test();
Run Code Online (Sandbox Code Playgroud)

该实体User有一个带javax.persistence.Version注释的字段:

 @Version
 private Long version;
Run Code Online (Sandbox Code Playgroud)

当我执行查询时,版本字段不会更新,但如果不是我执行的查询:

User user = this.userRepository.findUserById(1L);
user.setFirstName("blabla");
this.userRepository.save(user);
Run Code Online (Sandbox Code Playgroud)

版本字段已更新.为什么?

jpa version jpa-2.0 spring-data spring-data-jpa

7
推荐指数
1
解决办法
837
查看次数

MongoDB日志文件

我的配置日志文件有问题.我正在尝试记录所有操作,但是唯一保存的操作是 服务器重新启动 .我的配置文件:

##store data here
dbpath=C:\data\db

profile=2

##all output go here
logpath=C:\mongodb\log\mongo.log

logappend=true
##log read and write operations
diaglog=3
Run Code Online (Sandbox Code Playgroud)

我错过了什么?有没有办法用java spring(也许是xml)配置mongo日志文件?

logging mongodb

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

如何从aspectj中排除方法

我正在尝试使用aspectj从日志文件中排除几种方法(我只使用spring和Load-time编织).有没有办法列出aop.xml中的排除方法?我知道我可以为全班做这个,但我正在寻找具体的方法.或者我可以在方面类中列出一个列表?谢谢

aop aspectj spring-aop

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

Spring Security 3.2.4中的ConcurrentSessionControlStrategy

我有一个使用 ConcurrentSessionControlStrategy 和我自己的 sessionRegistry 实现的工作配置。我升级到spring security 3.2.4并且必须将ConcurrentSessionControlStrategy更改为ConcurrentSessionControlAuthenticationStrategy。现在似乎 sessionRegistry 未连接,这意味着 ConcurrentSessionControlAuthenticationStrategy.onAuthenticaton 不会进入 sessionRegistry.registerNewSession。去什么?

我的配置xml:

    <security:http use-expressions="true" auto-config="false"
        entry-point-ref="loginUrlAuthenticationEntryPoint">


        <security:intercept-url pattern="/**"
            access="isAuthenticated()" />

        <security:custom-filter position="FORM_LOGIN_FILTER"
            ref="twoFactorAuthenticationFilter" />



        <security:logout logout-url="/player/logout"
            logout-success-url="/demo/player/logoutSuccess" />

        <security:session-management>
            <security:concurrency-control
                max-sessions="1" session-registry-ref="clusteredSessionRegistryImpl"
                error-if-maximum-exceeded="false" />
        </security:session-management>

    </security:http>



    <bean
        class="org.springframework.security.web.authentication.session.ConcurrentSessionControlAuthenticationStrategy">
        <constructor-arg ref="clusteredSessionRegistryImpl" />
        <property name="maximumSessions" value="1" />
    </bean>

    <bean id="loginUrlAuthenticationEntryPoint"
        class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint">
        <property name="loginFormUrl" value="/demo/player/login?login_error=true" />
    </bean>

    <bean id="twoFactorAuthenticationFilter" class="com.XXX.filter.TwoFactorAuthenticationFilter">
        <property name="authenticationManager" ref="authenticationManager" />
        <property name="authenticationFailureHandler" ref="failureHandler" />
        <property name="authenticationSuccessHandler" ref="playerAuthenticationSuccessHandler" />
        <property name="postOnly" value="true" />
    </bean>


    <bean id="failureHandler"
        class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler">
        <property name="defaultFailureUrl" …
Run Code Online (Sandbox Code Playgroud)

java spring spring-mvc spring-security

4
推荐指数
1
解决办法
4185
查看次数

如何将mongoexport与查询脚本文件一起使用

我正在尝试按照本教程:http://www.ultrabug.fr/tag/mongoexport/

并使用sh文件作为查询行.这是我的档案:

#!/bin/bash
d=`date --date="-3 month"`
echo "{ timeCreated: { "\$lte": $d} }"
Run Code Online (Sandbox Code Playgroud)

这是我的mongoexport行:

 mongoexport --db game_server --collection GameHistory -query /home/dev/test2.sh --out /home/dev/file.json
Run Code Online (Sandbox Code Playgroud)

我一直在:

assertion: 16619 code FailedToParse: FailedToParse: Expecting '{': offset:0 of:/home/dev/test2.sh
Run Code Online (Sandbox Code Playgroud)

为什么?我怎样才能做到这一点?

mongodb mongoexport

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