我将使用官方的Elasticsearch图像.我想要做的是在Docker运行期间设置索引的映射.
所以我需要在容器启动后立即执行.
curl -XPUT localhost:9200/_template/http_request -d {.....}
所以我不能在Dockerfile中这样做或者我可以吗?
谢谢
我想在一个项目中使用2种方法(反应式和标准式)。
我尝试将一个REST API端点迁移到反应式Webflux并测试性能,然后再迁移其余的。但这没有用。我为他添加了路由器和处理程序,但是直到我没有spring-boot-starter-web从依赖项中删除并禁用 @RestController我,我一直404都得到了HTTP 代码。有没有可能?还是应该将所有项目迁移到被动方法?
java reactive-programming spring-boot project-reactor spring-webflux
我正在尝试开发一个 SQS 侦听器,它在后台运行,并在新消息到达时从 AWS SQS 读取消息,并且它永远不应该删除该消息,因为将有一个单独的过程来删除消息。
这是一个独立的应用程序,刚刚开始开发。但无法进一步进行,因为基本的事情不起作用。我确信我错过了一些东西。我正在使用spring-cloud-aws-messaging (版本:1.2.0.BUILD-SNAPSHOT)。
这是一个非常简单的独立应用程序,具有以下文件: 一个 spring 配置文件:application-context.xml(内容已粘贴在上面) 一个 SQS 监听器:SBSQSMessageListener(内容已粘贴在上面) 一个正在加载 application-context.xml 的主程序&创建ApplicationContext
我的 Spring 配置文件:
<aws-context:context-region region="us-west-2"/>
<aws-context:context-credentials>
<aws-context:simple-credentials access-key="xxxxxxx" secret-key="xxxxxxxxxxxxx" />
</aws-context:context-credentials>
<aws-messaging:queue-messaging-template id="queueMessagingTemplate" />
<aws-messaging:annotation-driven-queue-listener task-executor="simpleTaskExecutor" />
<bean id="simpleTaskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<property name="corePoolSize" value="4" />
<property name="maxPoolSize" value="10" />
<property name="queueCapacity" value="1" />
<property name="WaitForTasksToCompleteOnShutdown" value="true" />
</bean>
Run Code Online (Sandbox Code Playgroud)
我的 SQSListener:
package sb.aws.sqs.listener;
import java.util.concurrent.ExecutionException;
import org.apache.log4j.Logger;
import org.springframework.cloud.aws.messaging.config.annotation.EnableSqs;
import org.springframework.cloud.aws.messaging.listener.annotation.SqsListener;
import org.springframework.cloud.aws.messaging.listener.Acknowledgment;
import org.springframework.cloud.aws.messaging.listener.SqsMessageDeletionPolicy;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.stereotype.Component;
@Component
@EnableSqs
public class …Run Code Online (Sandbox Code Playgroud) 在使用DefaultJmsListenerContainerFactoryspring 订阅消息和使用故障转移activemq传输订阅骆驼时,我一直在获得INFO消息以下的消息。
2016-08-25 15:00:07,235 [ActiveMQ Task-1] INFO transport.failover.FailoverTransport Successfully connected to tcp://localhost:61616
2016-08-25 15:00:08,265 [ActiveMQ Task-1] INFO transport.failover.FailoverTransport Successfully connected to tcp://localhost:61616
2016-08-25 15:00:08,265 [ActiveMQ Task-1] INFO transport.failover.FailoverTransport Successfully connected to tcp://localhost:61616
2016-08-25 15:00:09,296 [ActiveMQ Task-1] INFO transport.failover.FailoverTransport Successfully connected to tcp://localhost:61616
2016-08-25 15:00:09,328 [ActiveMQ Task-1] INFO transport.failover.FailoverTransport Successfully connected to tcp://localhost:61616
2016-08-25 15:00:10,299 [ActiveMQ Task-1] INFO transport.failover.FailoverTransport Successfully connected to tcp://localhost:61616
2016-08-25 15:00:10,346 [ActiveMQ Task-1] INFO transport.failover.FailoverTransport Successfully connected to tcp://localhost:61616
2016-08-25 15:00:11,318 [ActiveMQ Task-1] INFO transport.failover.FailoverTransport …Run Code Online (Sandbox Code Playgroud) 我正在使用带有 DBI 的数据源:
@Autowired
DataSource dataSource;
@Bean
public DBI dbiBean() {
DBI dbi = new DBI(dataSource);
return dbi;
}
Run Code Online (Sandbox Code Playgroud)
我不知道如何配置日志框架来记录 SQL 语句。我试过:
logging:
level:
org.hibernate: TRACE
org.skife.jdbi: TRACE
java.sql: TRACE
Run Code Online (Sandbox Code Playgroud)
但它不起作用。
@feignclient春季如何在配置中设置自定义最大连接池大小,
@FeignClient(name = "content-cms", configuration = ContentCmsServiceFeignConfig.class)
public interface FeignService {
@RequestMapping(value = "/test/", method = RequestMethod.GET)
String getSample(@RequestParam("token") String token, @RequestParam("cid") String cid,
@RequestParam("ratio") String ratio, @RequestParam("s") String source);
}
Run Code Online (Sandbox Code Playgroud) java ×3
spring-boot ×3
spring ×2
amazon-sqs ×1
apache-camel ×1
docker ×1
feign ×1
jdbi ×1
jms ×1
logging ×1
spring-cloud ×1
spring-jms ×1