Package org.activemq.util

Examples of org.activemq.util.IdGenerator.generateId()


    protected PeerTransportChannel(WireFormat wireFormat, String serviceName) throws JMSException {
        this.wireFormat = wireFormat;
        this.serviceName = serviceName;
        this.discoveryURI = MulticastDiscoveryAgent.DEFAULT_DISCOVERY_URI;
        IdGenerator idGen = new IdGenerator();
        this.brokerName = idGen.generateId();
        this.brokerConnectorURI = DEFAULT_BROKER_CONNECTOR_URI;
        this.doDiscovery = true;
        if (serviceName == null || serviceName.length() == 0) {
            throw new IllegalStateException("No service name specified for peer:// protocol");
        }
View Full Code Here


                                                                                this.getTopic(),
                                                                                this.getEmbeddedBroker());

        if (this.getDurable()) {
            IdGenerator idGenerator = new IdGenerator();
            connection.setClientID(idGenerator.generateId());
        }

        // Start connection before receiving messages.
        connection.start();
View Full Code Here

                                                                                ACTIVEMQ_SERVER,
                                                                                this.getTopic(),
                                                                                this.getEmbeddedBroker());
        if (this.getDurable()) {
            IdGenerator idGenerator = new IdGenerator();
            connection.setClientID(idGenerator.generateId());
        }

        Session session = ServerConnectionFactory.createSession(connection,
                                                                this.getTransacted(),
                                                                ACTIVEMQ_SERVER,
View Full Code Here

                System.out.println("Loading Message Broker from file: " + file);
                factory.setResource(new FileSystemResource(file));
            }

            IdGenerator idgen = new IdGenerator();
            BrokerContainer container = factory.createBrokerContainer(idgen.generateId(), BrokerContext.getInstance());
            container.start();

            // lets wait until we're killed.
            Object lock = new Object();
            synchronized (lock) {
View Full Code Here

        MessageProducer publisher = null;
        Connection connection = createConnectionFactory(brokerUrl, isEmbeddedBroker);

        if (isPersistent) {
            IdGenerator idGenerator = new IdGenerator();
            connection.setClientID(idGenerator.generateId());
        }

        Session session = createSession(connection, TRANSACTED_FALSE);
        Destination destination = createDestination(session, subject, isTopic);
        publisher = session.createProducer(destination);
View Full Code Here

    protected void subscribe(String subject) throws JMSException {
        Connection connection = createConnectionFactory(brokerUrl, isEmbeddedBroker);

        if (isDurable) {
            IdGenerator idGenerator = new IdGenerator();
            connection.setClientID(idGenerator.generateId());
        }

        //Start the connection before receiving messages.
        connection.start();
        Session session = createSession(connection, TRANSACTED_FALSE);
View Full Code Here

     * A static factory method that can be used in Spring config files using a factory method
     * mechanism to create a broker container easily.
     */
    public static BrokerContainer newInstance(Resource resource) {
        IdGenerator idgen = new IdGenerator();
        return newInstance(resource, idgen.generateId());
    }

    /**
     * A static factory method that can be used in Spring config files using a factory method
     * mechanism to create a broker container easily.
View Full Code Here

    private void createBroker() throws ResourceAdapterInternalException {
        try {
            BrokerContainerFactory brokerContainerFactory = XmlConfigHelper.createBrokerContainerFactory(getBrokerXmlConfig());

            IdGenerator idgen = new IdGenerator();
            container = brokerContainerFactory.createBrokerContainer(idgen.generateId(), BrokerContext.getInstance());
            container.start();
            connectionFactory = new ActiveMQConnectionFactory(container, getServerUrl());
        } catch (JMSException e) {
            log.error(e.toString(), e);
            throw new ResourceAdapterInternalException("Failed to startup an embedded broker", e);
View Full Code Here

                (ServerConnectionFactory.MANTARAY_SERVER.equals(this.getMQServer()))) {
                //Id set be server

            } else {
                IdGenerator idGenerator = new IdGenerator();
                connection.setClientID(idGenerator.generateId());
            }
        }

        session = ServerConnectionFactory.createSession(connection,
                                                        this.getTransacted(),
View Full Code Here

                (ServerConnectionFactory.MANTARAY_SERVER.equals(this.getMQServer()))) {
                //Id set by server

            } else {
                IdGenerator idGenerator = new IdGenerator();
                connection.setClientID(idGenerator.generateId());
            }
        }

        //start connection before receiving messages.
        connection.start();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.