Controller类中的HTTP路由多次调用Cordapp

问题描述 投票:0回答:1

我看到路由/问题的多个调用不确定为什么这样的行为


    // initiate a flow using this route

    @GetMapping(value = "/issue", produces = TEXT_PLAIN_VALUE)
    private String issue() throws FlowException {
        Party traderB = proxy.networkMapSnapshot().get(2).getLegalIdentities().get(0);

        proxy.startFlowDynamic(com.template.flows.IssueMetal.class,"Gold",10,traderB).toString();

        return proxy.registeredFlows().toString();
    }

并且当我查询库时,我看到多个未使用状态,而我应该只看到一个条目。

[StateAndRef(state=TransactionState(data=com.template.states.MetalState@3fa2279c, contract=com.template.contracts.TemplateContract, notary=O=Notary, L=London, C=GB, encumbrance=null, constraint=SignatureAttachmentConstraint(key=EC Public Key [4b:44:7c:7b:1b:38:a6:93:bd:9a:c4:1d:8b:46:b4:6b:77:ba:f8:0e]
            X: 38d226dcd0fa574316da478aa75225e6ce18f65cbd96e60bf3c8251b1965417
            Y: 56e5dcf7ccab21b712601ed0278501f2f33d0b5fdaa4c09e62639464e4910871
)), ref=45F75698C7D5FBE1AC0D88108C2C33F73567335168973B501B902312FA46ADBC(0)), StateAndRef(state=TransactionState(data=com.template.states.MetalState@3b9da4b0, contract=com.template.contracts.TemplateContract, notary=O=Notary, L=London, C=GB, encumbrance=null, constraint=SignatureAttachmentConstraint(key=EC Public Key [4b:44:7c:7b:1b:38:a6:93:bd:9a:c4:1d:8b:46:b4:6b:77:ba:f8:0e]
            X: 38d226dcd0fa574316da478aa75225e6ce18f65cbd96e60bf3c8251b1965417
            Y: 56e5dcf7ccab21b712601ed0278501f2f33d0b5fdaa4c09e62639464e4910871
)), ref=55E228CEA0F793068EC112978E584623211B869E647BD48DD6CB2211230D3205(0)), StateAndRef(state=TransactionState(data=com.template.states.MetalState@7e9f2da7, contract=com.template.contracts.TemplateContract, notary=O=Notary, L=London, C=GB, encumbrance=null, constraint=SignatureAttachmentConstraint(key=EC Public Key [4b:44:7c:7b:1b:38:a6:93:bd:9a:c4:1d:8b:46:b4:6b:77:ba:f8:0e]
            X: 38d226dcd0fa574316da478aa75225e6ce18f65cbd96e60bf3c8251b1965417
            Y: 56e5dcf7ccab21b712601ed0278501f2f33d0b5fdaa4c09e62639464e4910871
)), ref=912FD9296E430B6302B76DE0F6E25458D313D6F4E7AB29DDF80387F0099735FC(0))]

我有4个节点

TraderA,TraderB,薄荷,公证人

此流程正在从Mint发布到TraderB。

java spring http corda
1个回答
0
投票
我相信Ashutosh是正确的。您的端点似乎被多次触发,这是您在此处看到所见内容的唯一原因。
© www.soinside.com 2019 - 2024. All rights reserved.