Apache Camel Bindy不在Linux机器上工作,而同样的事情在Windows上工作

时间:2015-03-17 15:45:54

标签: java linux apache-camel

我正在使用Apache camel bindy来解析修复消息。我可以在Windows机器上运行它,但在Linux机器上我遇到错误

The pair separator property of the annotaon @Message must be specified

以下是我的修正消息

package com.fm.fixconnector.seb;

import org.apache.camel.dataformat.bindy.annotation.KeyValuePairField;
import org.apache.camel.dataformat.bindy.annotation.Message;

import com.fm.fixconnector.domain.AbstractMarketData;

@Message(pairSeparator = "\\u0001",keyValuePairSeparator = "=" , type = "FIX", version = "4.3")
public class QuoteData implements AbstractMarketData {

    @KeyValuePairField(tag = 131)
    private String quoteId;

    private double price;

    @KeyValuePairField(tag = 132)
    private double bidPrice;

    @KeyValuePairField(tag = 133)
    private double offerPrice;

    @KeyValuePairField(tag = 54)
    private String priceType;

    @KeyValuePairField(tag = 15)
    private String currency;

    @KeyValuePairField(tag = 55)
    private String symbol;

    @KeyValuePairField(tag = 38)
    private int quantity;

    public double getPrice() {
        if ("1".equalsIgnoreCase(priceType))
            return getOfferPrice();
        else
            return getBidPrice();
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public double getBidPrice() {
        return bidPrice;
    }

    public void setBidPrice(double bidPrice) {
        this.bidPrice = bidPrice;
    }

    public double getOfferPrice() {
        return offerPrice;
    }

    public void setOfferPrice(double offerPrice) {
        this.offerPrice = offerPrice;
    }

    public String getPriceType() {
        return priceType;
    }

    public void setPriceType(String priceType) {
        this.priceType = priceType;
    }

    public String getQuoteId() {
        return quoteId;
    }

    public void setQuoteId(String quoteId) {
        this.quoteId = quoteId;
    }

    public String getCurrency() {
        return currency;
    }

    public String getSymbol() {
        return symbol;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;

    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("MarketData [");
        if (getPrice() != 0) {
            builder.append("price=");
            builder.append(getPrice());
            builder.append(", ");
        }
        if (bidPrice != 0) {
            builder.append("bid price=");
            builder.append(bidPrice);
            builder.append(", ");
        }
        if (offerPrice != 0) {
            builder.append("offer price=");
            builder.append(offerPrice);
            builder.append(", ");
        }
        if (quoteId != null) {
            builder.append("quoteId=");
            builder.append(quoteId);
            builder.append(", ");
        }
        if (priceType != null) {
            builder.append("priceType=");
            builder.append(priceType);
        }
        builder.append("]");
        return builder.toString();
    }

}

以下是为此

定义的上下文
 <unmarshal ref="bindyDataformatSEBPrice">
                            <bindy type="KeyValue" classType="com.fm.fixconnector.seb.QuoteData" locale="en-us"/>
                        </unmarshal> 

请帮助我,因为我在过去的两天里一直在努力,但仍然没有成功。任何帮助将非常感激。我正在使用Ubuntu。

0 个答案:

没有答案