Search in sources :

Example 1 with ZPublisher

use of com.xrtb.bidder.ZPublisher in project XRTB by benmfaul.

the class TestSpark method transmit.

public void transmit() throws Exception {
    String crid = "111";
    WinObject obj = new WinObject();
    obj.cost = ".001";
    obj.price = ".001";
    obj.adId = "123";
    obj.cridId = crid;
    BidResponse br = new BidResponse();
    br.adid = "123";
    br.crid = crid;
    br.cost = .001;
    PixelClickConvertLog cmd = new PixelClickConvertLog();
    cmd.ad_id = "123";
    cmd.creative_id = crid;
    ZPublisher wins = new ZPublisher("tcp://*:5572", "wins");
    ZPublisher bids = new ZPublisher("tcp://*:5571", "bids");
    ZPublisher clicks = new ZPublisher("tcp://*:5573", "clicks");
    for (int j = 0; j < 1000; j++) {
        wins.add(obj);
        bids.add(br);
        cmd.type = PixelClickConvertLog.CLICK;
        clicks.add(cmd);
        cmd.type = PixelClickConvertLog.PIXEL;
        clicks.add(cmd);
    }
}
Also used : PixelClickConvertLog(com.xrtb.commands.PixelClickConvertLog) WinObject(com.xrtb.pojo.WinObject) ZPublisher(com.xrtb.bidder.ZPublisher) BidResponse(com.xrtb.pojo.BidResponse)

Example 2 with ZPublisher

use of com.xrtb.bidder.ZPublisher in project XRTB by benmfaul.

the class TestZZZRedis method testSetup.

@BeforeClass
public static void testSetup() {
    try {
        Config.setup();
        System.out.println("******************  TestZZZRedis");
        com.xrtb.jmq.RTopic channel = new com.xrtb.jmq.RTopic("tcp://*:5575");
        channel.subscribe("responses");
        channel.addListener(new com.xrtb.jmq.MessageListener<BasicCommand>() {

            @Override
            public void onMessage(String channel, BasicCommand cmd) {
                System.out.println("<<<<<<<<<<<<<<<<<" + cmd);
                rcv = cmd;
                latch.countDown();
            }
        });
        commands = new ZPublisher("tcp://*:5580", "commands");
    } catch (Exception error) {
        error.printStackTrace();
        fail("No connection: " + error.toString());
    }
}
Also used : BasicCommand(com.xrtb.commands.BasicCommand) ZPublisher(com.xrtb.bidder.ZPublisher) BeforeClass(org.junit.BeforeClass)

Aggregations

ZPublisher (com.xrtb.bidder.ZPublisher)2 BasicCommand (com.xrtb.commands.BasicCommand)1 PixelClickConvertLog (com.xrtb.commands.PixelClickConvertLog)1 BidResponse (com.xrtb.pojo.BidResponse)1 WinObject (com.xrtb.pojo.WinObject)1 BeforeClass (org.junit.BeforeClass)1