小编whe*_*ler的帖子

`#![feature]` 可能无法在稳定发布通道上使用

我正在尝试使用clap板条箱进行一些参数解析。但是,当我将其添加到我的时Cargo.toml,我会收到以下错误cargo build

$ cargo build
   Compiling rustix v0.36.5
error[E0554]: `#![feature]` may not be used on the stable release channel
  --> /home/wheeler/.cargo/registry/src/github.com-1ecc6299db9ec823/rustix-0.36.5/src/lib.rs:99:26
   |
99 | #![cfg_attr(rustc_attrs, feature(rustc_attrs))]
   |                          ^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
   --> /home/wheeler/.cargo/registry/src/github.com-1ecc6299db9ec823/rustix-0.36.5/src/lib.rs:116:5
    |
116 |     feature(core_intrinsics)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
   --> /home/wheeler/.cargo/registry/src/github.com-1ecc6299db9ec823/rustix-0.36.5/src/lib.rs:116:13
    |
116 |     feature(core_intrinsics)
    |             ^^^^^^^^^^^^^^^

For more information about this error, try `rustc …
Run Code Online (Sandbox Code Playgroud)

rust

11
推荐指数
2
解决办法
3473
查看次数

从Gradle脚本运行shell命令

我正在努力弄清楚如何从Gradle运行shell命令,因为看起来Gradle使得它很难做到这一点.

这是命令:

git branch --merged | grep -v \* | grep -v master | grep -v develop | grep -v dmz | xargs git branch -D
Run Code Online (Sandbox Code Playgroud)

这只是一个方便的命令来清理已经合并的本地分支.

这是我创建的任务:

task gitCleanLocalBranches {
    doLast {
        exec {
            workingDir '.'
            commandLine 'git branch --merged | grep -v \\* | grep -v master | grep -v develop | grep -v dmz | xargs git branch -D'

        }
    }
}
Run Code Online (Sandbox Code Playgroud)

任务失败:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task …
Run Code Online (Sandbox Code Playgroud)

shell gradle

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

Docker容器只能使用--net = host访问Internet

刚刚使用安装指南安装了docker 1.10.1.但是,除非我--net=hostdocker run命令中使用,否则我的容器都不能访问Internet .我试过这些帖子的各种解决方法:

  1. http://odino.org/cannot-connect-to-the-internet-from-your-docker-containers/
  2. 我的码头集装箱没有互联网
  3. 我无法让Docker容器访问互联网?
  4. Docker容器无法访问Internet

到目前为止,除了添加--net=host到run命令之外没有任何工作,但我无法从Dockerfile构建图像,因为我无法使用--net=hostbuild命令.

我跑去docker network inspect bridge检查docker网桥的设置,发现它使用(几乎)与我的工作VPN相同的子网和网关.这可能导致问题吗?这也可以解释为什么当我连接到我的工作VPN时,一些站点无法加载.

这是由以下结果docker network inspect bridge:

[
    {
        "Name": "bridge",
        "Id": "6d603ebd1c437d0d1f02be8406cf362f7f36d33168e42b9883891bae99834fa9",
        "Scope": "local",
        "Driver": "bridge",
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.17.0.0/16",
                    "Gateway": "172.17.0.1"
                }
            ]
        },
        "Containers": {},
        "Options": {
            "com.docker.network.bridge.default_bridge": "true",
            "com.docker.network.bridge.enable_icc": "true",
            "com.docker.network.bridge.enable_ip_masquerade": "true",
            "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
            "com.docker.network.bridge.name": "docker0",
            "com.docker.network.driver.mtu": "1500"
        }
    }
]
Run Code Online (Sandbox Code Playgroud)

这是ifconfig:

docker0   Link encap:Ethernet …
Run Code Online (Sandbox Code Playgroud)

dns dnsmasq docker

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

Spring Integration Service Activator不发送空回复

我有一个非常简单的集成流程:

    <int:gateway id="integrationGateway"
                 service-interface="com.wheeler.fits.returns.messaging.MessagingGateway"
                 default-request-channel="transactionMatcher">
        <int:method name="publishReturnedTransaction" request-channel="transactionMatcher"/>
    </int:gateway>

    <int:channel id="transactionMatcher"/>
    <int:service-activator input-channel="transactionMatcher" requires-reply="true">
        <bean class="com.wheeler.fits.returns.domain.MatchTransactionToOriginal">
            <constructor-arg ref="achTransactionMapper"/>
            <constructor-arg ref="bankTransactionDao"/>
            <constructor-arg ref="clientMapper"/>
            <constructor-arg ref="oldAchTransactionMapper"/>
        </bean>
    </int:service-activator>
Run Code Online (Sandbox Code Playgroud)

服务激活器正在调用的方法尝试将消息中的数据与DB中的某些数据进行匹配。如果是,它将返回匹配的数据。如果没有,它将返回null

如果未设置required-reply=true,则null答复似乎从集成流程中消失了,导致服务接口永不返回,导致应用程序挂起。如果我确实设置了required-reply=true,我至少会得到一个异常,但是应用程序仍然会挂起,因为网关的服务接口永远不会返回:

[org.springframework.integration.handler.ReplyRequiredException: No reply produced by handler 'org.springframework.integration.config.ServiceActivatorFactoryBean#0', and its 'requiresReply' property is set to true.,
Run Code Online (Sandbox Code Playgroud)

在Spring Integration参考资料中的任何地方似乎都没有记录这种行为。我希望我的服务激活器将其传递null回网关,以便网关可以使用进行回复null

这是我的网关服务接口:

public interface MessagingGateway {

    RawMessageData publishReturnedTransaction(ReturnedTransactionData returnedTransactionData) throws ChannelPublishException;
}
Run Code Online (Sandbox Code Playgroud)

我如何null像处理其他任何消息一样处理它?

java spring-integration

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

禁用卡夫卡会话超时

我试图通过Apache Camel的源代码来确定错误的来源。尽管StringDeserializer为使用者配置了a ,但我仍然收到此错误:

org.apache.kafka.common.errors.SerializationException: Can't convert key of class [B to class org.apache.kafka.common.serialization.StringSerializer specified in key.serializer
Caused by: java.lang.ClassCastException: [B cannot be cast to java.lang.String
    at org.apache.kafka.common.serialization.StringSerializer.serialize(StringSerializer.java:28)
Run Code Online (Sandbox Code Playgroud)

当我尝试逐步了解Camel以找出反序列化的String仍然如何以字节数组结尾时,Camel会继续关闭自身,因为协调器认为Consumer已死:

20:45:04.171 [kafka-coordinator-heartbeat-thread | rtp-creditor-receive-payment] INFO  o.a.k.c.c.i.AbstractCoordinator - [Consumer clientId=consumer-1, groupId=rtp-creditor-receive-payment] Marking the coordinator rtp-demo-cluster-kafka-0.rtp-demo-cluster-kafka-brokers.rtp-reference.svc.cluster.local:9092 (id: 2147483647 rack: null) dead
Run Code Online (Sandbox Code Playgroud)

如何完全禁用所有超时,以便可以单步执行源代码而不必担心使用者被标记为已死?

apache-camel apache-kafka

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

给定进程 ID 在 PowerShell 中终止进程树

假设我从 PowerShell 运行了几个进程:

$p1 = $(Start-Process -PassThru ./example.exe)
$p2 = $(Start-Process -PassThru ./example.exe)
Run Code Online (Sandbox Code Playgroud)

example.exe 将产生几个同名的子进程。

如何在不杀死及其子进程的情况下杀死just 及其子进程?$p1$p2

只是运行Stop-Process $p1只会杀死父进程$p1,让它的子进程继续运行。

到目前为止,我看到的所有答案都涉及杀死具有特定名称的所有进程,但这在这里不起作用。

powershell

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

Jenkins Git Publisher标签未检测到环境变量

在我的Jenkins bash脚本中,我导出以下环境变量:

export TAG_NAME=v$LIVE_VERSION.$LIVE_BUILD
Run Code Online (Sandbox Code Playgroud)

在Git发布者部分,我试图创建一个标签名称字段填充为的标签$TAG_NAME,但它试图以字面意义创建一个具有名称的标签,$TAG_NAME而不是替换环境变量的值。

注意:这不是 SO问题的重复内容,因为答案适用于询问者,但由于某些原因对我无效。

git bash jenkins

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