All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.moquette.broker.MemoryQueueRepository Maven / Gradle / Ivy

There is a newer version: 0.17
Show newest version
package io.moquette.broker;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;

public class MemoryQueueRepository implements IQueueRepository {

    private Map> queues = new HashMap<>();

    @Override
    public Queue createQueue(String cli, boolean clean) {
        final ConcurrentLinkedQueue queue = new ConcurrentLinkedQueue<>();
        queues.put(cli, queue);
        return queue;
    }

    @Override
    public Map> listAllQueues() {
        return Collections.unmodifiableMap(queues);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy