2016-07-08 11 views
1

Apache Apolloをインストールして正常に実行しました。私はそのウェブダッシュボードhttp://127.0.0.1:61680/にアクセスすることができます。Apache Apollo Connection Refused

私はSTOMP経由で接続したいと思います。私はこれを行うために[StompKit] [1]ライブラリを使用しています。接続

private let host: String = "127.0.0.1" 
private let port: UInt = 61680 

private var client: STOMPClient! 

override func viewDidLoad() { 
    super.viewDidLoad() 

    client = STOMPClient(host: host, port: port) 
    connect() 
} 

接続が拒否したエラーで失敗します。

これはapollo.xmlファイルです。

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<!-- 
    Licensed to the Apache Software Foundation (ASF) under one or more 
    contributor license agreements. See the NOTICE file distributed with 
    this work for additional information regarding copyright ownership. 
    The ASF licenses this file to You under the Apache License, Version 
    2.0 (the "License"); you may not use this file except in compliance 
    with the License. You may obtain a copy of the License at 
    http://www.apache.org/licenses/LICENSE-2.0 Unless required by 
    applicable law or agreed to in writing, software distributed under 
    the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES 
    OR CONDITIONS OF ANY KIND, either express or implied. See the 
    License for the specific language governing permissions and 
    limitations under the License. 
--> 

<!-- 
    For more information on how configure this file please 
    reference: 

    http://activemq.apache.org/apollo/versions/1.7.1/website/documentation/user-manual.html 
    --> 
<broker xmlns="http://activemq.apache.org/schema/activemq/apollo"> 

    <notes> 
    The default configuration with tls/ssl enabled. 
    </notes> 

    <log_category console="console" security="security" connection="connection" audit="audit"/> 


    <authentication domain="apollo"/> 
    <!-- Give admins full access --> 
    <access_rule allow="admins" action="*"/> 
    <access_rule allow="*" action="connect" kind="connector"/> 


    <virtual_host id="mybroker"> 
    <!-- 
     You should add all the host names that this virtual host is known as 
     to properly support the STOMP 1.1 virtual host feature. 
     --> 
    <host_name>mybroker</host_name> 
    <host_name>localhost</host_name> 
    <host_name>127.0.0.1</host_name> 

    <!-- Uncomment to disable security for the virtual host --> 
    <!-- <authentication enabled="false"/> --> 

    <!-- Uncomment to disable security for the virtual host --> 
    <!-- <authentication enabled="false"/> --> 
    <access_rule allow="users" action="connect create destroy send receive consume"/> 


    <!-- You can delete this element if you want to disable persistence for this virtual host --> 
    <leveldb_store directory="${apollo.base}/data"/> 


    </virtual_host> 

    <web_admin bind="http://127.0.0.1:61680"/> 
    <web_admin bind="https://127.0.0.1:61681"/> 

    <connector id="tcp" bind="tcp://0.0.0.0:61613" connection_limit="2000"/> 
    <connector id="tls" bind="tls://0.0.0.0:61614" connection_limit="2000"/> 
    <connector id="ws" bind="ws://0.0.0.0:61623" connection_limit="2000"/> 
    <connector id="wss" bind="wss://0.0.0.0:61624" connection_limit="2000"/> 

    <key_storage file="${apollo.base}/etc/keystore" password="password" key_password="password"/> 

</broker> 

試み1

は、私だけは、これに関連見つけることができる答え[この] [2](それはMQTTのためですが)です。とにかく、私はauthentication行を追加してapollo.xmlファイルを修正しました。

<virtual_host id="mybroker"> 
    <authentication enabled="false"/> 
... 

しかし、それは何も変わりませんでした。

試み2:

ウェブダッシュボードには、ユーザー名/パスワードログインを持っています。そこで私はStompKitの別の方法を試しました。

client.connectWithLogin("admin", passcode: "password") { connectedFrame, error in 
    if let error = error { 
     print("Error during connecting: \(error.localizedDescription)") 
    } else { 
     print("Connected!") 
    } 
} 

なおエラーは解決しません。

私はここで間違っていますか?

答えて

0

デフォルトでは、STOMPクライアントはポートのApolloに接続できます。ポート61680はウェブ管理インターフェース用です。

あなたの設定が

<connector id="tcp" bind="tcp://0.0.0.0:61613" connection_limit="2000"/> 

ので、私はあなたのコード内

private let port: UInt = 61613 

が問題


ノート解決する必要があることを前提と含まれています。あなたがいることを確認するには、netstatやTCPViewを使用することができますがポート61613は開いている

+0

ポート番号を '61613'に変更しましたが、同じエラーが発生しました。ホストを0.0.0.0に変更して、もう一度試しましたが、まだ運がありません。 – Isuru

関連する問題