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
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) |
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 | |
# gevent | |
from gevent import sleep | |
# Zato | |
from zato.common.broker_message import SERVICE | |
from zato.common.util import new_cid |
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 | |
import gc | |
# Zato | |
from zato.common.broker_message import SERVICE | |
from zato.common.util import new_cid | |
from zato.server.base.parallel import ParallelServer | |
from zato.server.service import Integer, 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
from zato.server.service import Service | |
class MyService(Service): | |
def handle(self): | |
import pymqi | |
queue_manager = 'IDM' |
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
# -*- coding: utf-8 -*- | |
from __future__ import absolute_import, division, print_function, unicode_literals | |
# Zato | |
from zato.server.service import Service | |
ORDER_CACHE_PREFIX = 'order.{}' | |
class AcceptOrder(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
from zato.server.service import Service | |
class Dicts(Service): | |
def handle(self): | |
service = 'zato.kvdb.data-dict.dictionary.get-key-list' | |
request = {'system':'System'} | |
response = self.invoke(service, request) |
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 |
NewerOlder