This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# At most 10 concurrent connections from a client | |
acl too_fast fe_sess_rate ge 10 | |
# Matches any path beginning with a given prefix | |
acl bursts_inclined path_beg -i /client1 | |
# Effectively working as a delay mechanism for clients that are too fast | |
tcp-request inspect-delay 1000ms | |
# Fast-path - accept connection if it's not this troublesome client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import absolute_import, division, print_function, unicode_literals | |
# stdlib | |
from random import choice | |
# Zato | |
from zato.server.service import Service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import absolute_import, division, print_function, unicode_literals | |
# stdlib | |
from json import dumps | |
from random import choice | |
# Zato | |
from zato.server.service import Service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymqi | |
queue_manager = 'QM01' | |
channel = 'SVRCONN.1' | |
host = '192.168.1.135' | |
port = '1434' | |
queue_name = 'TEST.1' | |
message = 'Hello from Python!' | |
conn_info = '{}({})'.format(host, port) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
frontend front_http_plain | |
mode http | |
default_backend bck_http_plain | |
acl too_fast fe_sess_rate ge 10 | |
acl bursts_inclined path_beg -i /client1 | |
tcp-request inspect-delay 1000ms | |
tcp-request content accept unless bursts_inclined too_fast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have solved the problem by modifying these lines in zato. I do not know if this has been the best method , but it has worked to give ZATO connectivity with SqlServer. | |
First of all , I installed and configured FreeTDS and unixODBC (http://blog.tryolabs.com/2012/06/25/connecting-sql-server-database-python-under-ubuntu/) | |
Then: | |
In /opt/zato/2.0.0/local/zato-common/src/zato/common/init.py, | |
add 'mssql+pyodbc': 'SELECT 1', | |
to var: ping_queries | |
In /opt/zato/2.0.0/zato-web-admin/src/zato/admin/zato_settings.py, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy import create_engine | |
config = { | |
'username': 'zato1', | |
'password': 'zato1', | |
'database': 'zato1', | |
} | |
url = 'postgresql+pg8000://{username}:{password}@localhost/{database}'.format(**config) | |
engine = create_engine(url, echo=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy import create_engine | |
from sqlalchemy.orm import sessionmaker | |
config = { | |
'username': 'zato1', | |
'password': 'zato1', | |
'database': 'zato1', | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# stdlib | |
from json import dumps | |
def to_json(model): | |
""" Returns a JSON representation of an SQLAlchemy-backed object. | |
""" | |
json = {} | |
json['fields'] = {} | |
json['pk'] = getattr(model, 'id') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from zato.server.service import Service | |
class GetFullSecurityDefinitions(Service): | |
def handle(self): | |
for value in self.worker_store.request_dispatcher.url_data.basic_auth_config.values(): | |
self.logger.info('\n%s', value.config) |
NewerOlder