How to retract a message in ejabberd? - xmpp

I'm creating a MUC client and I want to implement some kind of message deletion in the client. I read that deleting an individual message from ejabberd is not possible yet. But how can I use XEP-0424 for the achieve a similar purpose? I've read, written and tested the use case described in that XEP, but no success.
The client send a message like this:
<message xmlns="jabber:client" to="myroom#conference.localhost" type="groupchat">
<body>9</body>
<urls />
<origin-id xmlns="urn:xmpp:sid:0" id="358f5b60-3d10-11ea-be33-5f58c62bedc3" />
</message>
The server broadcasts this:
<message xmlns="jabber:client" to="user1#localhost/1132254315040517635831042" from="myroom#conference.localhost" id="1579690081679918">
<archived xmlns="urn:xmpp:mam:tmp" by="user1#localhost" id="1579690081690608" />
<stanza-id xmlns="urn:xmpp:sid:0" by="user1#localhost" id="1579690081690608" />
<event xmlns="http://jabber.org/protocol/pubsub#event">
<items node="urn:xmpp:mucsub:nodes:messages">
<item id="1579690081679918">
<message xmlns="jabber:client" xml:lang="en" to="user1#localhost" from="myroom#conference.localhost/user1" type="groupchat">
<archived xmlns="urn:xmpp:mam:tmp" by="myroom#conference.localhost" id="1579690081679918" />
<stanza-id xmlns="urn:xmpp:sid:0" by="myroom#conference.localhost" id="1579690081679918" />
<urls />
<origin-id xmlns="urn:xmpp:sid:0" id="358f5b60-3d10-11ea-be33-5f58c62bedc3" />
<body>9</body>
</message>
</item>
</items>
</event>
</message>
Retraction message sent:
<message xmlns="jabber:client" to="myroom#conference.localhost" type="groupchat">
<apply-to xmlns="urn:xmpp:fasten:0" id="358f5b60-3d10-11ea-be33-5f58c62bedc3">
<retract xmlns="urn:xmpp:message-retract:0" />
</apply-to>
</message>
As result of the retraction message sent, the server broadcasts this:
<message xmlns="jabber:client" to="user1#localhost/1132254315040517635831042" from="myroom#conference.localhost" id="2725765463385791444">
<event xmlns="http://jabber.org/protocol/pubsub#event">
<items node="urn:xmpp:mucsub:nodes:messages">
<item id="2725765463385791444">
<message xmlns="jabber:client" xml:lang="en" to="user1#localhost" from="myroom#conference.localhost/user1" type="groupchat">
<apply-to xmlns="urn:xmpp:fasten:0" id="358f5b60-3d10-11ea-be33-5f58c62bedc3">
<retract xmlns="urn:xmpp:message-retract:0" />
</apply-to>
</message>
</item>
</items>
</event>
</message>
And when I query the history for the room, I receive this:
<message xmlns="jabber:client" to="user1#localhost/395000986606606742032146" from="myroom#conference.localhost">
<result xmlns="urn:xmpp:mam:2" id="1579690081679918">
<forwarded xmlns="urn:xmpp:forward:0">
<message xmlns="jabber:client" xml:lang="en" from="myroom#conference.localhost/user1" type="groupchat">
<x xmlns="http://jabber.org/protocol/muc#user">
<item jid="user1#localhost/1132254315040517635831042" />
</x>
<archived xmlns="urn:xmpp:mam:tmp" by="myroom#conference.localhost" id="1579690081679918" />
<stanza-id xmlns="urn:xmpp:sid:0" by="myroom#conference.localhost" id="1579690081679918" />
<urls />
<origin-id xmlns="urn:xmpp:sid:0" id="358f5b60-3d10-11ea-be33-5f58c62bedc3" />
<body>9</body>
</message>
<delay xmlns="urn:xmpp:delay" from="conference.localhost" stamp="2020-01-22T10:48:01.679918Z" />
</forwarded>
</result>
</message>
What am I missing? Shouldn't I receive something like a tombstone of the message?
So far, my settings are:
ejabberd 19.09.1
Using the MucSub approach
mod_man is configured
Persisting with MySQL 5.7
strophe.js 1.3.4
And this is my ejabberd.yml:
hosts:
- "localhost"
loglevel: 4
log_rotate_size: 10485760
log_rotate_date: ""
log_rotate_count: 1
log_rate_limit: 100
certfiles:
- "/etc/letsencrypt/live/localhost/fullchain.pem"
- "/etc/letsencrypt/live/localhost/privkey.pem"
ca_file: "/etc/letsencrypt/live/localhost/cacert.pem"
sql_type: mysql
sql_server: "localhost"
sql_database: "ejabberd"
sql_username: "ejabberd"
sql_password: "****"
sql_port: 3306
auth_method: sql
default_db: sql
listen:
-
port: 5222
ip: "::"
module: ejabberd_c2s
max_stanza_size: 262144
shaper: c2s_shaper
access: c2s
starttls_required: false
-
port: 5269
ip: "::"
module: ejabberd_s2s_in
max_stanza_size: 524288
-
port: 5443
ip: "::"
module: ejabberd_http
tls: true
request_handlers:
"/admin": ejabberd_web_admin
"/api": mod_http_api
"/bosh": mod_bosh
"/captcha": ejabberd_captcha
"/upload": mod_http_upload
### "/ws": ejabberd_http_ws
"/oauth": ejabberd_oauth
-
port: 5280
ip: "::"
module: ejabberd_http
request_handlers:
"/admin": ejabberd_web_admin
"/websocket": ejabberd_http_ws
-
port: 1883
ip: "::"
module: mod_mqtt
backlog: 1000
s2s_use_starttls: optional
acl:
local:
user_regexp: ""
loopback:
ip:
- 127.0.0.0/8
- ::1/128
- ::FFFF:127.0.0.1/128
admin:
user:
- "admin#localhost"
access_rules:
local:
allow: local
c2s:
deny: blocked
allow: all
announce:
allow: admin
configure:
allow: admin
muc_create:
allow: admin
pubsub_createnode:
allow: local
trusted_network:
allow: loopback
api_permissions:
"console commands":
from:
- ejabberd_ctl
who: all
what: "*"
"admin access":
who:
access:
allow:
acl: loopback
acl: admin
oauth:
scope: "ejabberd:admin"
access:
allow:
acl: loopback
acl: admin
what:
- "*"
- "!stop"
- "!start"
"public commands":
who:
ip: 127.0.0.1/8
what:
- status
- connected_users_number
shaper:
normal: 1000
fast: 50000
shaper_rules:
max_user_sessions: 10
max_user_offline_messages:
5000: admin
100: all
c2s_shaper:
none: admin
normal: all
s2s_shaper: fast
max_fsm_queue: 10000
acme:
contact: "mailto:admin#localhost"
ca_url: "https://acme-v01.api.letsencrypt.org"
modules:
mod_adhoc: {}
mod_admin_extra: {}
mod_announce:
access: announce
mod_avatar: {}
mod_blocking: {}
mod_bosh: {}
mod_caps: {}
mod_carboncopy: {}
mod_client_state: {}
mod_configure: {}
mod_disco: {}
mod_fail2ban: {}
mod_http_api: {}
mod_http_upload:
put_url: https://#HOST#:5443/upload
mod_last: {}
mod_mam:
## Mnesia is limited to 2GB, better to use an SQL backend
## For small servers SQLite is a good fit and is very easy
## to configure. Uncomment this when you have SQL configured:
db_type: sql
assume_mam_usage: true
default: always
mod_mqtt: {}
mod_muc:
access:
- allow
access_admin:
- allow: admin
access_create: muc_create
access_persistent: muc_create
access_mam:
- allow
default_room_options:
allow_query_users: false
allow_subscription: true # enable MucSub
mam: true
persistent: true
public: false
public_list: false
mod_muc_admin: {}
mod_offline:
access_max_user_messages: max_user_offline_messages
mod_ping: {}
mod_privacy: {}
mod_private: {}
mod_proxy65:
access: local
max_connections: 5
mod_pubsub:
access_createnode: pubsub_createnode
plugins:
- flat
- pep
force_node_config:
## Avoid buggy clients to make their bookmarks public
storage:bookmarks:
access_model: whitelist
mod_push: {}
mod_push_keepalive: {}
mod_register:
## Only accept registration requests from the "trusted"
## network (see access_rules section above).
## Think twice before enabling registration from any
## address. See the Jabber SPAM Manifesto for details:
## https://github.com/ge0rg/jabber-spam-fighting-manifesto
ip_access: trusted_network
mod_roster:
versioning: true
mod_s2s_dialback: {}
mod_shared_roster: {}
mod_stream_mgmt:
resend_on_timeout: if_offline
mod_vcard: {}
mod_vcard_xupdate: {}
mod_version:
show_os: false
### Local Variables:
### mode: yaml
### End:
### vim: set filetype=yaml tabstop=8
I apologize for the long message, but it provides the context.

Currently ejabberd does not support XEP-0424 so this won't work.

Related

spring boot data initialize with data.sql gets error

I am trying to initialize the database using a sql file at the startup of the application.
Here is my application.yml
server:
port: 8090
servlet:
context-path: /data-service
logging:
config: classpath:logback-spring.xml
spring:
profiles:
active: default
datasource:
driverClassName: org.postgresql.Driver
url: jdbc:postgresql://localhost:5432/my_db
username: db_user
password: db_pwd
jpa:
generate-ddl: true
hibernate:
ddl-auto: update
database-platform: org.hibernate.dialect.PostgreSQL9Dialect
show-sql: true
defer-datasource-initialization: true
sql:
init:
mode: always
platform: postgresql
and here is my insert script
insert into region (id,country,region_code,federal_state,city,location,part_of_town,post_code) VALUES (gen_random_uuid(), 'DE', 'DE-BW', 'Baden-Württemberg', 'Freiburg', 'Breisgau-Hochschwarzwald', 'Bad Krozingen"', '79189');
but it gets a script error while starting the application
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "insert"
Position: 1
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:356)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:490)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:408)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:329)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:315)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:291)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:286)
at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:94)
at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
at org.springframework.jdbc.datasource.init.ScriptUtils.executeSqlScript(ScriptUtils.java:261)
... 28 common frames omitted
couldnt find a way to solve it, thanks

CamelCase resgitraiton of eureka app using REST API

I'm using eureka server,Config server and zuul server,and registering a rest service using Eureka REST API provided at
Eureka REST Operations
eureka url to register : http://localhost:8761/eureka/apps/DemoClient
with post body as below :
{
"instance": {
"instanceId":"localhost:DemoClient58181",
"hostName": "localhost",
"app": "DemoClient",
"ipAddr": "localhost",
"vipAddress": "DemoClient",
"secureVipAddress": "DemoClient",
"status": "UP",
"port": {"$": "58181", "#enabled": "true"},
"healthCheckUrl": "http://localhost:58181/healthcheck",
"statusPageUrl": "http://localhost:58181/status",
"homePageUrl": "http://localhost:58181",
"dataCenterInfo": {
"#class": "com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo",
"name": "MyOwn"
}
}
}
i can see the app registered as below
<application>
<name>DEMOCLIENT</name>
<instance>
<instanceId>localhost:58181</instanceId>
<hostName>localhost</hostName>
<app>DEMOCLIENT</app>
<ipAddr>localhost</ipAddr>
<status>UP</status>
<overriddenstatus>UNKNOWN</overriddenstatus>
<port enabled="true">58181</port>
<securePort enabled="false">7002</securePort>
<countryId>1</countryId>
<dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
<name>MyOwn</name>
</dataCenterInfo>
<leaseInfo>
<renewalIntervalInSecs>30</renewalIntervalInSecs>
<durationInSecs>90</durationInSecs>
<registrationTimestamp>1523540991583</registrationTimestamp>
<lastRenewalTimestamp>1523540991583</lastRenewalTimestamp>
<evictionTimestamp>0</evictionTimestamp>
<serviceUpTimestamp>1523538580531</serviceUpTimestamp>
</leaseInfo>
<metadata class="java.util.Collections$EmptyMap"/>
<homePageUrl>http://localhost:58181</homePageUrl>
<statusPageUrl>http://localhost:58181/status</statusPageUrl>
<healthCheckUrl>http://localhost:58181/healthcheck</healthCheckUrl>
<vipAddress>DemoClient</vipAddress>
<secureVipAddress>DemoClient</secureVipAddress>
<isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
<lastUpdatedTimestamp>1523540991583</lastUpdatedTimestamp>
<lastDirtyTimestamp>1523540991075</lastDirtyTimestamp>
<actionType>ADDED</actionType>
</instance>
</application>
when request with url http://localhost:58080/democlient/sayhello is accessed
but http://localhost:58080/DemoClient/sayhello is not accessed
when i add route configuration in zuul as
zuul:
ignoredServices: '*'
routes:
DemoClient:
path: /DemoClient/**
serviceId: DEMOCLIENT
then the CameCase route works.
Is there any way, how i can access route registering with CamelCase via REST api and not specifying route configuration in zuul.

Why eureka considers a service still 'UP' even if its last renewal time was two days ago

I have a service with 2 replicas running. But I found the service having 3 UP instances in eureka's dashboard.
Below the detail info of the service in eureka. The problematic instance is 8d0c39f3ed9b:ocr-server:8095, whose last renewal time was two days ago. And the status and health url can NOT be accessed. I'm wondering why eureka considers it's UP!
<application>
<name>OCR-SERVER</name>
<instance>
<instanceId>211a4634b45f:ocr-server:8095</instanceId>
<hostName>211a4634b45f</hostName>
<app>OCR-SERVER</app>
<ipAddr>10.0.0.38</ipAddr>
<status>UP</status>
<overriddenstatus>UNKNOWN</overriddenstatus>
<port enabled="true">8095</port>
<securePort enabled="false">443</securePort>
<countryId>1</countryId>
<dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
<name>MyOwn</name>
</dataCenterInfo>
<leaseInfo>
<renewalIntervalInSecs>30</renewalIntervalInSecs>
<durationInSecs>90</durationInSecs>
<registrationTimestamp>1505589414444</registrationTimestamp>
<lastRenewalTimestamp>1505833520772</lastRenewalTimestamp>
<evictionTimestamp>0</evictionTimestamp>
<serviceUpTimestamp>1505589414444</serviceUpTimestamp>
</leaseInfo>
<metadata class="java.util.Collections$EmptyMap"/>
<homePageUrl>http://211a4634b45f:8095/</homePageUrl>
<statusPageUrl>http://211a4634b45f:8096/manage/info</statusPageUrl>
<healthCheckUrl>http://211a4634b45f:8096/manage/health</healthCheckUrl>
<vipAddress>ocr-server</vipAddress>
<secureVipAddress>ocr-server</secureVipAddress>
<isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
<lastUpdatedTimestamp>1505589414444</lastUpdatedTimestamp>
<lastDirtyTimestamp>1505589412731</lastDirtyTimestamp>
<actionType>ADDED</actionType>
</instance>
<instance>
<instanceId>8d0c39f3ed9b:ocr-server:8095</instanceId>
<hostName>8d0c39f3ed9b</hostName>
<app>OCR-SERVER</app>
<ipAddr>10.0.0.38</ipAddr>
<status>UP</status>
<overriddenstatus>UNKNOWN</overriddenstatus>
<port enabled="true">8095</port>
<securePort enabled="false">443</securePort>
<countryId>1</countryId>
<dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
<name>MyOwn</name>
</dataCenterInfo>
<leaseInfo>
<renewalIntervalInSecs>30</renewalIntervalInSecs>
<durationInSecs>90</durationInSecs>
<registrationTimestamp>1505589356797</registrationTimestamp>
<lastRenewalTimestamp>1505589356797</lastRenewalTimestamp>
<evictionTimestamp>0</evictionTimestamp>
<serviceUpTimestamp>1505589356797</serviceUpTimestamp>
</leaseInfo>
<metadata class="java.util.Collections$EmptyMap"/>
<homePageUrl>http://8d0c39f3ed9b:8095/</homePageUrl>
<statusPageUrl>http://8d0c39f3ed9b:8096/manage/info</statusPageUrl>
<healthCheckUrl>http://8d0c39f3ed9b:8096/manage/health</healthCheckUrl>
<vipAddress>ocr-server</vipAddress>
<secureVipAddress>ocr-server</secureVipAddress>
<isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
<lastUpdatedTimestamp>1505589356797</lastUpdatedTimestamp>
<lastDirtyTimestamp>1505589356787</lastDirtyTimestamp>
<actionType>ADDED</actionType>
</instance>
<instance>
<instanceId>0c62739f5ca8:ocr-server:8095</instanceId>
<hostName>0c62739f5ca8</hostName>
<app>OCR-SERVER</app>
<ipAddr>10.0.0.34</ipAddr>
<status>UP</status>
<overriddenstatus>UNKNOWN</overriddenstatus>
<port enabled="true">8095</port>
<securePort enabled="false">443</securePort>
<countryId>1</countryId>
<dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
<name>MyOwn</name>
</dataCenterInfo>
<leaseInfo>
<renewalIntervalInSecs>30</renewalIntervalInSecs>
<durationInSecs>90</durationInSecs>
<registrationTimestamp>1505589403150</registrationTimestamp>
<lastRenewalTimestamp>1505833509700</lastRenewalTimestamp>
<evictionTimestamp>0</evictionTimestamp>
<serviceUpTimestamp>1505589403150</serviceUpTimestamp>
</leaseInfo>
<metadata class="java.util.Collections$EmptyMap"/>
<homePageUrl>http://0c62739f5ca8:8095/</homePageUrl>
<statusPageUrl>http://0c62739f5ca8:8096/manage/info</statusPageUrl>
<healthCheckUrl>http://0c62739f5ca8:8096/manage/health</healthCheckUrl>
<vipAddress>ocr-server</vipAddress>
<secureVipAddress>ocr-server</secureVipAddress>
<isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
<lastUpdatedTimestamp>1505589403150</lastUpdatedTimestamp>
<lastDirtyTimestamp>1505589400020</lastDirtyTimestamp>
<actionType>ADDED</actionType>
</instance>
</application>
The config of eureka client looks like below,
eureka:
instance:
statusPageUrlPath: /info
healthCheckUrlPath: /health
preferIpAddress: false
client:
fetchRegistry: true
registryFetchIntervalSeconds: 5
healthcheck:
enabled: true
serviceUrl:
defaultZone: http://eureka-peer1:8761/eureka,http://eureka-peer2:8761/eureka
The configuration of eureka server is,
eureka:
instance:
preferIpAddress: true
enableSelfPreservation: false
homePageUrl: http://${eureka.hostname}/
---
spring:
profiles: peer1
eureka:
instance:
hostname: eureka-peer1
client:
serviceUrl:
defaultZone: http://eureka-peer2:${server.port}/eureka/
---
spring:
profiles: peer2
eureka:
instance:
hostname: eureka-peer2
client:
serviceUrl:
defaultZone: http://eureka-peer1:${server.port}/eureka/
And both the eureka clients and servers are running in docker swarm.
Your server has probably entered the self preservation mode, that's why you see a stale instance there.
I see you have the enableSelfPreservation: false option however it is not in the right section, it should be eureka.server.enableSelfPreservation, your entry is under eureka.instance.enableSelfPreservation which is not right.

How to configure outbound-socket-binding for SMTP mail in wildfly swarm for using yaml?

I am porting an application from Wildfly 10.0.1.0 to Wildly Swarm 2017.7.0.
Everything went rather smoothly except for the SMTP e-mail configuration using YAML:
I tried some alternatives, but here is the latest one based on what I think the yaml would be from standalone.xml mapping - project-defaults.yml
swarm:
socket-binding-groups:
mail-socket:
outbound-socket-bindings:
mail-smtp:
remote-host: smtp.someprovider.com
remote-port: 587
mail:
mail-sessions:
smtpSession:
jndi-name: java:/smtpSession
smtp-server:
username: username_here
password: password_here
tls: true
outbound-socket-binding-ref: mail-smtp
However I still get error:
2017-08-05 11:17:36,100 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "mail"),
("mail-session" => "smtpSession")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.outbound-socket-binding.mail-smtp"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.mail-session.smtpSession is missing [jboss.outbound-socket-binding.mail-smtp]"]
}
2017-08-05 11:17:36,155 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0184: New missing/unsatisfied dependencies:
service jboss.outbound-socket-binding.mail-smtp (missing) dependents: [service jboss.mail-session.smtpSession]
------------------ Edited August 7th, 2017 -------------------
As advised by Ladicek I tried this:
swarm:
socket-binding-groups:
standard-sockets:
mail-socket:
outbound-socket-bindings:
mail-smtp:
remote-host: smtp.someprovider.com
remote-port: 587
and
swarm:
socket-binding-groups:
standard-sockets:
outbound-socket-bindings:
mail-smtp:
remote-host: smtp.someprovider.com
remote-port: 587
and
swarm:
socket-binding-groups:
standard-socket:
outbound-socket-bindings:
mail-smtp:
remote-host: smtp.someprovider.com
remote-port: 587
However neither is working, still have the same error.
Could anyone please help on this?
---------------------- SOLVED ----------------------------
Need to upgrade to 2017.8.1 and use the below configuration
network:
socket-binding-groups:
standard-sockets:
outbound-socket-bindings:
mail-smtp:
remote-host: smtp.someprovider.com
remote-port: 587
Thank you.
From the top of my head, I believe there's one level of the YAML structure you're missing: you need to select the socket binding group to which you add the socket binding. That's an artifact of WildFly's managed domain, which is a concept that doesn't apply to Swarm, yet you sometimes run into it. There's only one socket binding group in standalone WildFly and hence in Swarm: standard-sockets.
So the YAML will look like:
swarm:
socket-binding-groups:
standard-sockets:
mail-socket:
...
Also for any kind of questions about the Swarm YAML structure, consult https://reference.wildfly-swarm.io
Finally solved:
Need to upgrade to 2017.8.1 and use the below configuration
network:
socket-binding-groups:
standard-sockets:
outbound-socket-bindings:
mail-smtp:
remote-host: smtp.someprovider.com
remote-port: 587
Thank you.
This worked for me.
yml File:
swarm:
mail:
mail-sessions:
mail-socket:
jndi-name: java:/mail/NGSoftMail
smtp-server:
username: sigafco#xxxmail.com.co
password: *****
outbound-socket-binding-ref: mail-smtp
debug: true
from: sigafco#xxxmail.com.co
network:
socket-binding-groups:
standard-sockets:
outbound-socket-bindings:
mail-smtp:
remote-host: xxxmail.com.co
remote-port: 25
java File:
#ApplicationScoped
#Path("mailsender")
public class MailSender {
#Resource(mappedName = "java:/mail/NGSoftMail")
private Session session;
#GET
#Path("mail")
public String sendGet() throws Exception {
Message message = new MimeMessage(session);
message.setFrom();
message.setRecipients(Message.RecipientType.TO, InternetAddress.parse("david.vasquez#xxx.com.co", false));
message.setSubject("asunto!!!");
message.setSentDate(new Date());
message.setContent("contenido!!!", "text/html; charset=UTF-8");
Transport.send(message);
return String.format("{\"your_mail\": \"%s\"}", "OK");
}
}
pom file:
<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>mail</artifactId>
</dependency>

Tsung load testing not able to send message ejabberd server

I am new to this tsung load testing framework, since last one week i have been exploring this tool to load test my ejabberd server till now i am able to register some 200 users at one go that is awesome, i am able to generate report Graphs (right now it is blank all over).
My problem is I am not able to send message from the sendmessage.xml file to my any other user through I am new to this tsung load testing framework, since last one week i have been exploring this tool to load test my ejabberd server till now i am able to register some 200 users at one go that is awesome, i am able to generate report Graphs (right now it is blank all over).
My problem is I am not able to send message from the sendmessage.xml file to my any other user through my ejabberd instance here is my sendmessage.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd" [] >
<tsung loglevel="info" backend="json">
<clients>
<client host="localhost" use_controller_vm="true"/>
</clients>
<servers>
<server host="*.*.*.*" port="5222" type="tcp"/>
</servers>
<load duration="12" unit="minute">
<arrivalphase phase="1" duration="12" unit="minute">
<users maxnumber="100" interarrival="1" unit="second"></users>
</arrivalphase>
</load>
<options>
<option type="ts_jabber" name="global_number" value="5"></option>
<option type="ts_jabber" name="userid_max" value="200000" />
<option type="ts_jabber" name="domain" value="hostname.com" />
<option type="ts_jabber" name="username" value="andupandu" />
<option type="ts_jabber" name="passwd" value="password" />
</options>
<sessions>
<session probability="100" name="xmpp-connection" type="ts_jabber">
<request> <jabber type="connect" ack="local"></jabber> </request>
<thinktime value="2"></thinktime>
<request><jabber type="starttls" ack="bidi_ack" />
</request>
<thinktime value="5"></thinktime>
<transaction name="authenticate">
<request> <jabber type="auth_sasl_anonymous" ack="local"></jabber> </request>
<request> <jabber type="connect" ack="local"></jabber> </request>
<request> <jabber type="auth_sasl_bind" ack="local" ></jabber></request>
<request> <jabber type="auth_sasl_session" ack="local" ></jabber></request>
<request> <jabber type="presence:initial" ack="no_ack"/> </request>
</transaction>
<thinktime value="5"></thinktime>
<transaction name="online">
<request> <jabber type="chat" ack="no_ack" size="4000" destination="online"/></request>
</transaction>
<transaction name="close">
<request> <jabber type="close" ack="local"></jabber> </request>
</transaction>
</session>
</sessions>
</tsung>
While running this script i was going my ejabberd.log file this is coming
2016-12-19 11:02:43.553 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30840>) Accepted connection 223.30.185.182:46844 -> 122.166.14.59:5222
2016-12-19 11:02:43.772 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30841>) Accepted connection 223.30.185.182:48205 -> 122.166.14.59:5222
2016-12-19 11:02:44.266 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30842>) Accepted connection 223.30.185.182:48358 -> 122.166.14.59:5222
2016-12-19 11:02:45.530 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30843>) Accepted connection 223.30.185.182:46427 -> 122.166.14.59:5222
2016-12-19 11:02:45.689 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30844>) Accepted connection 223.30.185.182:48789 -> 122.166.14.59:5222
2016-12-19 11:02:46.872 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30845>) Accepted connection 223.30.185.182:34836 -> 122.166.14.59:5222
2016-12-19 11:02:48.092 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30846>) Accepted connection 223.30.185.182:33801 -> 122.166.14.59:5222
2016-12-19 11:02:49.144 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30847>) Accepted connection 223.30.185.182:33990 -> 122.166.14.59:5222
2016-12-19 11:02:50.479 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30848>) Accepted connection 223.30.185.182:50522 -> 122.166.14.59:5222
2016-12-19 11:02:51.676 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30849>) Accepted connection 223.30.185.182:40768 -> 122.166.14.59:5222
2016-12-19 11:02:52.925 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30850>) Accepted connection 223.30.185.182:57973 -> 122.166.14.59:5222
2016-12-19 11:02:53.759 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30851>) Accepted connection 223.30.185.182:41619 -> 122.166.14.59:5222
2016-12-19 11:02:54.371 [info] <0.606.0>#ejabberd_listener:accept:333 (#Port<0.30852>) Accepted connection 223.30.185.182:42115 -> 122.166.14.59:5222
... and similar
the problem is session is not getting created
and folowing tsung.log i am getting
{
"stats": [
{"timestamp": 1482142630, "samples": []},
{"timestamp": 1482142640, "samples": [ {"name": "users", "value": 3, "max": 3}, {"name": "cpu", "hostname": "neureol", "value": 1, "mean": 5.301845187701585,"stddev": 0,"max": 5.301845187701585,"min": 5.301845187701585 ,"global_mean": 0 ,"global_count": 0}, {"name": "load", "hostname": "neureol", "value": 1, "mean": 0.37109375,"stddev": 0,"max": 0.37109375,"min": 0.37109375 ,"global_mean": 0 ,"global_count": 0}, {"name": "freemem", "hostname": "neureol", "value": 1, "mean": 4278.2265625,"stddev": 0,"max": 4278.2265625,"min": 4278.2265625 ,"global_mean": 0 ,"global_count": 0}, {"name": "users_count", "value": 3, "total": 3}, {"name": "finish_users_count", "value": 0, "total": 0}, {"name": "request", "value": 3, "mean": 264.84033203125,"stddev": 88.15162068742659,"max": 389.04296875,"min": 193.447021484375 ,"global_mean": 0 ,"global_count": 0}, {"name": "connect", "value": 3, "mean": 125.679931640625,"stddev": 42.371197826714514,"max": 185.3427734375,"min": 91.028076171875 ,"global_mean": 0 ,"global_count": 0}, {"name": "page", "value": 3, "mean": 264.84033203125,"stddev": 88.15162068742659,"max": 389.04296875,"min": 193.447021484375 ,"global_mean": 0 ,"global_count": 0}, {"name": "size_rcv", "value": 2024, "total": 2024}, {"name": "size_sent", "value": 501, "total": 501}, {"name": "connected", "value": 3, "max": 3}]},
{"timestamp": 1482142650, "samples": [ {"name": "users", "value": 7, "max": 7}, {"name": "cpu", "hostname": "neureol", "value": 1, "mean": 7.1357035553329995,"stddev": 0.0,"max": 7.1357035553329995,"min": 5.301845187701585 ,"global_mean": 5.301845187701585 ,"global_count": 1}, {"name": "load", "hostname": "neureol", "value": 1, "mean": 0.30859375,"stddev": 0.0,"max": 0.37109375,"min": 0.30859375 ,"global_mean": 0.37109375 ,"global_count": 1}, {"name": "freemem", "hostname": "neureol", "value": 1, "mean": 4275.30078125,"stddev": 0.0,"max": 4278.2265625,"min": 4275.30078125 ,"global_mean": 4278.2265625 ,"global_count": 1}, {"name": "users_count", "value": 4, "total": 7}, {"name": "finish_users_count", "value": 0, "total": 0}, {"name": "request", "value": 4, "mean": 522.1024780273438,"stddev": 425.6234764859712,"max": 1257.77099609375,"min": 193.447021484375 ,"global_mean": 264.84033203125 ,"global_count": 3}, {"name": "connect", "value": 4, "mean": 398.53875732421875,"stddev": 438.4391252124725,"max": 1156.155029296875,"min": 91.028076171875 ,"global_mean": 125.679931640625 ,"global_count": 3}, {"name": "page", "value": 4, "mean": 522.1024780273438,"stddev": 425.6234764859712,"max": 1257.77099609375,"min": 193.447021484375 ,"global_mean": 264.84033203125 ,"global_count": 3}, {"name": "size_rcv", "value": 2784, "total": 4808}, {"name": "size_sent", "value": 753, "total": 1254}, {"name": "connected", "value": 4, "max": 7}]}]}
If you see the tsung.log which is showing similar to {"name": "connected", "value": 3, "max": 3} how it is coming since there is no any log present there on ejbbered side .
After running perl script i am getting totally blank report with graph.
Here is my ijabberd.yml is :-
loglevel: 4
log_rotate_size: 10485760
log_rotate_date: ""
log_rotate_count: 1
log_rate_limit: 100
hosts:
- "something.com"
- "122.166.14.59"
- "demo.something.com"
listen:
-
port: 5222
module: ejabberd_c2s
certfile: "/opt/ejabberd-16.06/conf/server.pem"
starttls: true
## To enforce TLS encryption for client connections,
## use this instead of the "starttls" option:
## starttls_required: true
##
## Custom OpenSSL options
##
protocol_options:
- "no_sslv3"
## - "no_tlsv1"
max_stanza_size: 65536
shaper: c2s_shaper
access: c2s
resend_on_timeout: true
-
port: 5269
module: ejabberd_s2s_in
max_stanza_size: 131072
shaper: s2s_shaper
-
port: 5280
module: ejabberd_http
request_handlers:
"/websocket": ejabberd_http_ws
## "/pub/archive": mod_http_fileserver
web_admin: true
http_bind: true
## register: true
captcha: false
auth_method: internal
auth_method: anonymous
anonymous_protocol: both
allow_multiple_connections: true
host_config:
"something.com":
odbc_type: mysql
odbc_server: "localhost"
odbc_database: "chatdb"
odbc_username: "siteuser"
odbc_password: "site!##$"
auth_method: [odbc]
shaper:
##
## The "normal" shaper limits traffic speed to 1000 B/s
##
normal: 1000
##
## The "fast" shaper limits traffic speed to 50000 B/s
##
fast: 500000000
max_fsm_queue: 1000
shaper_rules:
## Maximum number of simultaneous sessions allowed for a single user:
max_user_sessions: 10
## Maximum number of offline messages that users can have:
max_user_offline_messages:
- allow: all
## For C2S connections, all users except admins use the "normal" shaper
c2s_shaper:
- none: admin
- fast
## All S2S connections use the "fast" shaper
s2s_shaper: fast
access_rules:
## This rule allows access only for local users:
local:
- allow: local
## Only non-blocked users can use c2s connections:
c2s:
- deny: blocked
- allow
## Only admins can send announcement messages:
announce:
- allow: admin
## Only admins can use the configuration interface:
configure:
- allow: admin
## Only accounts of the local ejabberd server can create rooms:
muc_create:
- allow: local
## Only accounts on the local ejabberd server can create Pubsub nodes:
pubsub_createnode:
- allow: local
## In-band registration allows registration of any possible username.
## To disable in-band registration, replace 'allow' with 'deny'.
register:
- allow
## Only allow to register from localhost
trusted_network:
- allow: all
registration_timeout: infinity
modules:
mod_adhoc: {}
mod_admin_extra: {}
mod_announce: # recommends mod_adhoc
access: announce
mod_blocking: {} # requires mod_privacy
mod_caps: {}
mod_carboncopy: {}
mod_client_state: {}
mod_configure: {} # requires mod_adhoc
mod_disco: {}
## mod_echo: {}
mod_http_bind: {}
mod_last: {}
mod_muc:
access:
- allow
access_admin:
- allow: admin
access_create: muc_create
access_persistent: muc_create
mod_muc_admin: {}
## mod_muc_log: {}
## mod_multicast: {}
mod_offline:
access_max_user_messages: max_user_offline_messages
mod_ping:
send_pings: true
ping_interval: 60
ping_ack_timout: 32
timeout_action: kill
mod_privacy: {}
mod_private: {}
mod_pubsub:
access_createnode: pubsub_createnode
## reduces resource comsumption, but XEP incompliant
ignore_pep_from_offline: true
## XEP compliant, but increases resource comsumption
## ignore_pep_from_offline: false
last_item_cache: false
plugins:
- "flat"
- "hometree"
- "pep" # pep requires mod_caps
mod_register:
welcome_message:
subject: "Welcome!"
body: |-
Hi.
Welcome to this XMPP server.
access: register
mod_roster: {}
mod_shared_roster: {}
mod_vcard:
search: false
mod_version: {}
allow_contrib_modules: true
After changing the ejabber log to 5 here is the ejabber.logs are :
2016-12-20 12:35:09.694 [info] <0.3540.1>#ejabberd_listener:accept:333 (#Port<0.123804>) Accepted connection 223.30.185.182:44998 -> *.*.*.*:5222
2016-12-20 12:35:09.696 [debug] <0.8478.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<?xml version='1.0'?><stream:stream id='1' to='something.com' xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'>">>
2016-12-20 12:35:09.696 [debug] <0.8479.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='12153081287775773739' from='something.com' version='1.0' xml:lang='en'>">>
2016-12-20 12:35:09.697 [debug] <0.8479.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='Xe/lYmivnmPRh4GEsNf6U13V4G8='/><register xmlns='http://jabber.org/features/iq-register'/><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>X-OAUTH2</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms></stream:features>">>
2016-12-20 12:35:10.043 [info] <0.3540.1>#ejabberd_listener:accept:333 (#Port<0.123801>) Accepted connection 223.30.185.182:36296 -> *.*.*.*:5222
2016-12-20 12:35:10.044 [debug] <0.8480.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<?xml version='1.0'?><stream:stream id='2' to='something.com' xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'>">>
2016-12-20 12:35:10.044 [debug] <0.8481.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='3424930239190161372' from='something.com' version='1.0' xml:lang='en'>">>
2016-12-20 12:35:10.045 [debug] <0.8481.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='Xe/lYmivnmPRh4GEsNf6U13V4G8='/><register xmlns='http://jabber.org/features/iq-register'/><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>X-OAUTH2</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms></stream:features>">>
2016-12-20 12:35:11.173 [info] <0.3540.1>#ejabberd_listener:accept:333 (#Port<0.123807>) Accepted connection 223.30.185.182:35101 -> *.*.*.*:5222
2016-12-20 12:35:11.175 [debug] <0.8482.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<?xml version='1.0'?><stream:stream id='3' to='something.com' xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'>">>
2016-12-20 12:35:11.175 [debug] <0.8483.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='10270498772362791845' from='something.com' version='1.0' xml:lang='en'>">>
2016-12-20 12:35:11.176 [debug] <0.8483.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='Xe/lYmivnmPRh4GEsNf6U13V4G8='/><register xmlns='http://jabber.org/features/iq-register'/><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>X-OAUTH2</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms></stream:features>">>
2016-12-20 12:35:11.872 [debug] <0.8478.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>">>
2016-12-20 12:35:11.872 [debug] <0.8478.1>#shaper:update:120 State: {maxrate,500000000,0.0,1482217509697017}, Size=51
M=5.1e-5, I=2175.696
2016-12-20 12:35:11.873 [debug] <0.8478.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<>>
2016-12-20 12:35:11.873 [debug] <0.8478.1>#shaper:update:120 State: {maxrate,500000000,11.719617122406575,1482217511872856}, Size=0
M=0.0, I=0.328
2016-12-20 12:35:12.157 [debug] <0.8480.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>">>
2016-12-20 12:35:12.157 [debug] <0.8480.1>#shaper:update:120 State: {maxrate,500000000,0.0,1482217510044454}, Size=51
M=5.1e-5, I=2113.04
2016-12-20 12:35:12.157 [debug] <0.8480.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<>>
2016-12-20 12:35:12.158 [debug] <0.8480.1>#shaper:update:120 State: {maxrate,500000000,12.067047354406341,1482217512157647}, Size=0
M=0.0, I=0.311
2016-12-20 12:35:13.303 [debug] <0.8482.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>">>
2016-12-20 12:35:13.303 [debug] <0.8482.1>#shaper:update:120 State: {maxrate,500000000,0.0,1482217511175417}, Size=51
M=5.1e-5, I=2128.331
2016-12-20 12:35:13.304 [debug] <0.8482.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<>>
2016-12-20 12:35:13.304 [debug] <0.8482.1>#shaper:update:120 State: {maxrate,500000000,11.980431023020751,1482217513303888}, Size=0
M=0.0, I=0.368
2016-12-20 12:35:15.202 [info] <0.3540.1>#ejabberd_listener:accept:333 (#Port<0.123812>) Accepted connection 223.30.185.182:49986 -> *.*.*.*:5222
2016-12-20 12:35:15.203 [debug] <0.8484.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<?xml version='1.0'?><stream:stream id='4' to='something.com' xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'>">>
2016-12-20 12:35:15.203 [debug] <0.8485.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='6574869083255218624' from='something.com' version='1.0' xml:lang='en'>">>
2016-12-20 12:35:15.204 [debug] <0.8485.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='Xe/lYmivnmPRh4GEsNf6U13V4G8='/><register xmlns='http://jabber.org/features/iq-register'/><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>X-OAUTH2</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms></stream:features>">>
2016-12-20 12:35:15.504 [info] <0.3540.1>#ejabberd_listener:accept:333 (#Port<0.123810>) Accepted connection 223.30.185.182:41718 -> *.*.*.*:5222
2016-12-20 12:35:15.505 [debug] <0.8486.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<?xml version='1.0'?><stream:stream id='5' to='something.com' xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'>">>
2016-12-20 12:35:15.506 [debug] <0.8487.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='11910276457718456980' from='something.com' version='1.0' xml:lang='en'>">>
2016-12-20 12:35:15.507 [debug] <0.8487.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='Xe/lYmivnmPRh4GEsNf6U13V4G8='/><register xmlns='http://jabber.org/features/iq-register'/><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>X-OAUTH2</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms></stream:features>">>
2016-12-20 12:35:16.979 [info] <0.3540.1>#ejabberd_listener:accept:333 (#Port<0.123799>) Accepted connection 223.30.185.182:57791 -> *.*.*.*:5222
2016-12-20 12:35:16.980 [debug] <0.8488.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<?xml version='1.0'?><stream:stream id='6' to='something.com' xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'>">>
2016-12-20 12:35:16.980 [debug] <0.8489.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='16257359711038503484' from='something.com' version='1.0' xml:lang='en'>">>
2016-12-20 12:35:16.981 [debug] <0.8489.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='Xe/lYmivnmPRh4GEsNf6U13V4G8='/><register xmlns='http://jabber.org/features/iq-register'/><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>X-OAUTH2</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms></stream:features>">>
2016-12-20 12:35:17.486 [debug] <0.8484.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>">>
2016-12-20 12:35:17.487 [debug] <0.8484.1>#shaper:update:120 State: {maxrate,500000000,0.0,1482217515203642}, Size=51
M=5.1e-5, I=2283.43
2016-12-20 12:35:17.487 [debug] <0.8484.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<>>
2016-12-20 12:35:17.487 [debug] <0.8484.1>#shaper:update:120 State: {maxrate,500000000,11.166760014941563,1482217517487205}, Size=0
M=0.0, I=0.271
2016-12-20 12:35:17.756 [debug] <0.8486.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>">>
2016-12-20 12:35:17.756 [debug] <0.8486.1>#shaper:update:120 State: {maxrate,500000000,0.0,1482217515505921}, Size=51
M=5.1e-5, I=2250.965
2016-12-20 12:35:17.757 [debug] <0.8486.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<>>
2016-12-20 12:35:17.757 [debug] <0.8486.1>#shaper:update:120 State: {maxrate,500000000,11.32786071795537,1482217517757008}, Size=0
M=0.0, I=0.314
2016-12-20 12:35:17.793 [info] <0.3540.1>#ejabberd_listener:accept:333 (#Port<0.123817>) Accepted connection 223.30.185.182:42577 -> *.*.*.*:5222
2016-12-20 12:35:17.803 [debug] <0.8490.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<?xml version='1.0'?><stream:stream id='7' to='something.com' xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'>">>
2016-12-20 12:35:17.803 [debug] <0.8491.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='3919444622270218959' from='something.com' version='1.0' xml:lang='en'>">>
2016-12-20 12:35:17.804 [debug] <0.8491.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='Xe/lYmivnmPRh4GEsNf6U13V4G8='/><register xmlns='http://jabber.org/features/iq-register'/><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>X-OAUTH2</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms></stream:features>">>
2016-12-20 12:35:18.762 [info] <0.3540.1>#ejabberd_listener:accept:333 (#Port<0.123818>) Accepted connection 223.30.185.182:37374 -> *.*.*.*:5222
2016-12-20 12:35:18.763 [debug] <0.8492.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<?xml version='1.0'?><stream:stream id='8' to='something.com' xmlns='jabber:client' version='1.0' xmlns:stream='http://etherx.jabber.org/streams'>">>
2016-12-20 12:35:18.763 [debug] <0.8493.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='11192005229436680642' from='something.com' version='1.0' xml:lang='en'>">>
2016-12-20 12:35:18.764 [debug] <0.8493.1>#ejabberd_c2s:send_text:1852 Send XML on stream = <<"<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='Xe/lYmivnmPRh4GEsNf6U13V4G8='/><register xmlns='http://jabber.org/features/iq-register'/><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>X-OAUTH2</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms></stream:features>">>
2016-12-20 12:35:19.210 [debug] <0.8488.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<"<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>">>
2016-12-20 12:35:19.210 [debug] <0.8488.1>#shaper:update:120 State: {maxrate,500000000,0.0,1482217516980265}, Size=51
M=5.1e-5, I=2230.46
2016-12-20 12:35:19.211 [debug] <0.8488.1>#ejabberd_receiver:process_data:284 Received XML on stream = <<>>
2016-12-20 12:35:19.211 [debug] <0.8488.1>#shaper:update:120 State: {maxrate,500000000,11.43193760582948,1482217519210858}, Size=0
M=0.0, I=0.277
Here is an example of my tsung xml file which working well with starttls:
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/home/ubuntu/tsung-1.7.0/tsung-1.0.dtd" []>
<tsung loglevel="warning" dumptraffic="false" version="1.0">
<clients>
<client host="localhost" use_controller_vm="false" cpu="8" maxusers="100000">
</client>
</clients>
<servers>
<server host="xmpp.example.com" port="5222" type="tcp"/>
</servers>
<load duration="30" unit="minute">
<!--user session="jabber-login" start_time="2" unit="second"></user-->
<!-- to make 24k online users -->
<arrivalphase phase="1" duration="30" unit="minute">
<users arrivalrate="20" unit="second"></users>
<session_setup name="jabber-login" probability="100"/>
</arrivalphase>
</load>
<options>
<option type="ts_jabber" name="global_number" value="500"/>
<option type="ts_jabber" name="userid_max" value="1000000"/>
<option type="ts_jabber" name="domain" value="mylowdown.com"/>
<option type="ts_jabber" name="username" value="tsung_"/>
<option type="ts_jabber" name="passwd" value="tsung_pwd"/>
</options>
<sessions>
<session probability="0" name="jabber-login" type="ts_jabber" bidi="true">
<transaction name="connect">
<request> <jabber type="connect" ack="local" /> </request>
<thinktime value="5"></thinktime>
<request> <jabber type="starttls" ack="bidi_ack" /> </request>
<request> <jabber type="connect" ack="local" /> </request>
</transaction>
<thinktime value="5"></thinktime>
<transaction name="authenticate">
<request> <jabber type="auth_sasl" ack="local"/> </request>
<request> <jabber type="connect" ack="local"/> </request>
<request> <jabber type="auth_sasl_bind" ack="local"/> </request>
<request> <jabber type="auth_sasl_session" ack="local"/> </request>
</transaction>
<transaction name="online">
<request> <jabber type="presence:initial" ack="no_ack"/> </request>
</transaction>
<thinktime value="5"></thinktime>
<for var="counter" from="1" to="21" incr="1">
<transaction name="online_msg">
<request>
<jabber type="chat" ack="no_ack" size="40" stamped="true" destination="online"/>
</request>
</transaction>
<thinktime value="15"/>
<transaction name="offline_msg">
<request>
<jabber type="chat" ack="no_ack" size="10" stamped="true" destination="offline"/>
</request>
</transaction>
<thinktime value="15"/>
</for>
<transaction name="close">
<request> <jabber type="close" ack="local"> </jabber></request>
</transaction>
</session>
</sessions>
</tsung>