我正在开发 Spring Boot 应用程序,它必须连接到具有不同端口甚至 IP 地址的多个 WebSphere JMS 连接。我需要接收和发送消息到不同的队列。
我从这个源中获取了连接示例 - https://github.com/lzp4ever/IBM_WebSphere_MQ_Spring_Boot_JMS
但是当我添加第二个 connectionFactory Spring Boot 无法启动时,它只是不知道使用哪个一次。
我的问题是我应该如何配置我的配置文件来监听多个队列?将 SpringBoot 应用程序连接到几个不同的 JMS 服务器是个好主意吗?
我需要upload_tmp_dir在我的PHP服务器上设置指令.我已经读过有一个我可以指定的php.ini文件.但我在Mac上找不到任何php.ini文件.我正在使用OSX 10.8.有什么建议?
谁能解释我为什么人们应该使用协程?是否有一些协程代码示例显示了比常规Java并发代码更好的完成时间(没有神奇的delay()函数,没有人delay()在生产中使用)?
在我的个人示例中,协程(第1行)反对Java代码(第2行)。也许我做错了什么?
例:
import kotlinx.coroutines.*
import java.time.Instant
import java.util.concurrent.CompletableFuture
import java.util.concurrent.Future
@ExperimentalCoroutinesApi
fun main() = runBlocking {
val begin = Instant.now().toEpochMilli()
val jobs = List(150_000) {
GlobalScope.launch { print(getText().await()) } // :1
// CompletableFuture.supplyAsync { "." }.thenAccept { print(it) } // :2
}
jobs.forEach { it.join() }
println(Instant.now().toEpochMilli() - begin)
}
fun getText(): Future<String> {
return CompletableFuture.supplyAsync {
"."
}
}
@ExperimentalCoroutinesApi
suspend fun <T> Future<T>.await(): T = suspendCancellableCoroutine { cont ->
cont.resume(this.get()) {
this.cancel(true)
} …Run Code Online (Sandbox Code Playgroud) java ×2
concurrency ×1
coroutine ×1
jms ×1
kotlin ×1
php ×1
spring ×1
spring-boot ×1
spring-jms ×1